Steven,

 

The problem is that the front controller for the entire application will still be instantiating all the required command classes at start up.

The command classes in turn will use the view locator in their constructors to get the view helpers they need.  So even though the

command hasn’t been called and doesn’t actually need to use the view; it is still trying to get an instance of the required view helper.

 

Sorry if im not making this totally clear! Like I said, the other solution is to only get the view helper instance when the view is required,

i.e. in execute(), onResult() and onFault().

 

The perfect solution? Cairngorm components with completely self contained services, controller and view locators wouldbe fantastic… ;)  Seriously

though, I do see your point, it is an architectural problem that needs more thought.

 

Sorry for the lack of details, I can write up a fuller description if required.

 

Cheers,

Mike

 


From: Steven Webster [mailto:[EMAIL PROTECTED]
Sent: 18 February 2005 10:16
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] Cairngorm and deferred instantiation

 

Michael,

 

Looking at this a little differently ... can you give us an idea as to why the ViewHelper not being instantiated

until the view is instantiated, is causing you a problem ?   Since the view helper exists to help you manipulate

a view, then if the view doesn't exist *arguably) the view helper needn't exist yet.

 

If you could provide a use-case as to why the view helper should exist before the view, perhaps we can

identify whether what you're trying to achieve, might be achieved more elegantly with a different strategy ?

 

Cairngorm is a lightweight framework, and it seems to me that your application use-case (having an

application that is composed of multiple applications that may or may not require to be created or

used at all by the user) may merit some additional architecture and infrastructure to manage the

application-specific problems that youare uncovering.

 

Best,

 

Steven

 

--

Steven Webster
Technical Director

iteration::two

 

This e-mail and any associated attachments transmitted with it may contain confidential information and must not be copied, or disclosed, or used by anyone other than the intended recipient(s). If you are not the intended recipient(s) please destroy this e-mail, and any copies of it, immediately.
 
Please also note that while software systems have been used to try to ensure that this e-mail has been swept for viruses, iteration::two do not accept responsibility for any damage or loss caused in respect of any viruses transmitted by the e-mail. Please ensure your own checks are carried out before any attachments are opened.

 

 


From:Michael Herron [mailto:[EMAIL PROTECTED]
Sent: 17 February 2005 17:14
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] Cairngorm and deferred instantiation

That’s certainly a workable strategy, but from a design point of view the separate “tabs” (in reality a view stack but works on same principles) are really applications within their own right and I would like to be able include them just by passing their root mxml name. Also, children will be added at run time to the view stack usingthe create child method so I don’t want to have to define all the required view helpers for applications that may not be loaded.

 

Looks like I will have to use the view locator 3 separate times in the execute, onResult and onFault methods…

 

Reply via email to