Personally couldn't see a problem with doing that Simon.

....hmmm a factory approach for multiple ModelLocators, now that would be
cool! Provided binding still worked that this is :]

m

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Simon Fifield
Sent: Wednesday, 5 October 2005 8:50 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm ModelLocator

HI

This brings up an interesting problem I had recently with the
ModelLocator.initialise() method. I am trying to use Binding to its full
use, but I had a situation where I was binding to a ModelLocator value
before it was being initialised and my view was screwed - the ModelLocator's
initialise call in the Applications initialize event handler - which gets
called after all the other initialize handlers.

So I just added a static variable "initialised:Boolean" and now I can
initialise the ModelLocator anywhere in the app either in a view or a
ViewHelper.

Do you guys think that this is a good, bad or indifferent approach?

Regards,
Simon

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Steven Webster
Sent: 04 October 2005 21:01
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm ModelLocator

Hey,

We would tend to have global model objects all hung off the one
ModelLocator.  For instance, we might have a class Assets.mxml which itself
contains 100+ attributes for embedded images, but we'll have one attribute
in ModelLocator called assets.

However, if you wanted to have multiple ModelLocators, I'd recommend a
factory strategy similar to the old cairngorm ViewLocator or ServiceLocator,
where the ModelLocator becomes a factory rather than a singleton, and you do
things like:

ModelLocator.getModel("assets").bannerImage

I've a funny feeling we considered this in the Cairngorm Committee, and
there were issues with data-binding that chose us to not go for this in the
general cairngorm package.

But I could be talking rubbish.

Steven

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: 04 October 2005 20:22
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm ModelLocator

Is the ModelLocator intended to be the *only* global repository for
variables to which you'll need to bind throughout your application? My
ModelLocator is getting huge, and I would like to split it into a few
ModelLocators (with different names, obviously). Has anyone done this?
Are there any caveats of which I should be aware? How have others dealt with
their ModelLocator's large size?




------------------------ Yahoo! Groups Sponsor --------------------~--> Get
Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> Most
low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to