PureMVC
Home
About
Code
Docs
FAQ
Forums
News
Showcase
Contact
Jobs
Welcome,
Guest
. Please
login
or
register
.
May 22, 2013, 01:06:39 PM
News:
ATTENTION: Spambots must die! Humans must visit
http://contact.futurescale.com
to request forum access.
PureMVC Architects Lounge
PureMVC Manifold
Port to AS3
Standard Version
instantiating views inside of their mediators
Pages: [
1
]
« previous
next »
Author
Topic: instantiating views inside of their mediators (Read 1467 times)
masterkrang
Newbie
Posts: 7
instantiating views inside of their mediators
«
on:
February 06, 2011, 07:46:45 PM »
Is it a good idea to instantiate you views within their mediators? I just received a project where the views were instantiated inside their mediators. Is there any benefit to me. I feel like this further couples the view to the mediator, and doesn't make a whole lot of sense. The way I'm used to doing it is to instantiate views in my main application, then on startup link your views to their mediators. Any advice? Thanks.
Logged
puremvc
Global Moderator
Hero Member
Posts: 2790
Re: instantiating views inside of their mediators
«
Reply #1 on:
February 08, 2011, 05:45:33 PM »
As long as the View Component doesn't import the Mediator's class, then the coupling is only one way: Mediator->View Component. That is the desired direction of coupling. It doesn't really matter if the mediator creates the View Component or gets it passed to it. It can help if you need deferred instantiation of a class at runtime.
-=Cliff>
Logged
masterkrang
Newbie
Posts: 7
Re: instantiating views inside of their mediators
«
Reply #2 on:
February 10, 2011, 11:25:27 AM »
Good to know, thanks Cliff. I decided to yank out a lot of the View functionality out of the Mediator. I started to think about what happens when I pull the View out of the application and drop it somewhere else, and in that light it seemed like the Mediator was doing too many thing for the View. In my mind, the Mediator is just there to facilitate interoperability between other part of the application, not to be like a mom that's always wiping the kid's nose. I also feel like instantiating the views inside the Mediators, then adding that view via viewComponent.addChild(view) isn't as readable as adding that view straight to the viewComponent itself. Just a thought...
Logged
Pages: [
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements and General Discussion
-----------------------------
=> General Discussion
=> Getting Started
=> Architecture
=> Public Demos, Tools and Applications
===> Fabrication
-----------------------------
PureMVC Manifold
-----------------------------
=> Port Authority
===> Contributor Central
===> Client Side
===> Server Side
=> Port to AS2
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to AS3
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to ColdFusion
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to C++
===> MultiCore Version
=====> Demos and Utils
=====> Bug Report
=> Port to CSharp
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Dart
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Haxe
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Java
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to JavaScript
===> Demos and Utils
===> Native JS Branch
=====> Bug Report
===> PrototypeJS Branch
=====> Bug Report
===> Objs Branch
=====> Bug Report
===> MooTools Branch
=====> Bug Report
===> ExtJS Branch
=====> Bug Report
=> Port to Objective C
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Perl
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to PHP
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Python
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Ruby
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to TypeScript
===> Standard Version
=====> Bug Report
=====> Demos and Utilities
===> MultiCore Version
=====> Bug Report
=====> Demos and Utilities
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.11
|
SMF © 2006-2007, Simple Machines LLC
Loading...
Copyright © 2006-2008 Futurescale, Inc.