Re: [flexcoders] Cairngorm Model Locator

2008-04-30 Thread Tom Chiverton
On Tuesday 29 Apr 2008, gerhard.schlager wrote:
 1) How can I make sure that unused data gets removed from the Model
 Locator? 

Why do you need to do so ?

-- 
Tom Chiverton
Helping to vitalistically negotiate B2C content
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
of members is available for inspection at the registered office. Any reference 
to a partner in relation to Halliwells LLP means a member of Halliwells LLP.  
Regulated by The Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.



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

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

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* 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/



RE: [flexcoders] Cairngorm Model Locator

2008-04-29 Thread Battershall, Jeff
Gerhard,

One approach I took is to have localized models that apply to specific
modules in the application, as opposed to having a proliferation of
variables that apply across multiple aspects of the application, which
could get ugly.  They still could live in the singleton Model Locator,
but could be condition 're-set' when no longer used or needed to be
refreshed. Like ModelLocator.getInstance().mylocalModel = new
MyLocalModel().

I'd think there'll be a lot of oppinions about how to approach this.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of gerhard.schlager
Sent: Tuesday, April 29, 2008 12:24 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm Model Locator


Hello!

I'm currently creating the software design for a large application which
we are going to build using Flex 3, Cairngorm 2.2.1 and SabreAMF (PHP).
I have already created my first prove of concept, however, I have a few
issues with Cairngorm's Model Locator.

1) How can I make sure that unused data gets removed from the Model
Locator? The simple solution would be to destroy the data that a view
loaded when the view gets closed. However, we are going to use flexmdi
and it's quite possible that one or more MDI windows are using the same
data. The only solution I've come up so far is to make the Model Locator
aware of which window uses which data. Therefore it could free the
unused data when no view uses it anymore. Yet, this could be a very
error-prone solution. Moreover, I would loose the last bit of loose
coupling. So, I'm not sure if that's a good way to handle this. Well,
the Model Locator itself is often seen as an anti-pattern as well ...

2) Should I really put everything into _one_ Model Locator? I guess
there could be quite a large number of public variables. Our application
will have up to 50 different views and about twice as many VO ...

I'd be really grateful if somebody could enlighten my ;-) or if you
could give me some tips on how to solve those two problems.

Thanks in advance for your help.

Best regards,
Gerhard




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





Re: [flexcoders] Cairngorm Model Locator

2008-04-29 Thread Ben Clinkinbeard
You definitely don't want your model keeping track of views using its data.
My 30 second recommendation would be to look into the UM Cairngorm
extensions as they can help you reduce the amount of clutter that needs to
be stored on the/a model. Specifically view callbacks is the feature that
helps enable that. Search flexcoders for additional discussion of UM
Cairngorm.

HTH,
Ben


On Tue, Apr 29, 2008 at 12:24 PM, gerhard.schlager 
[EMAIL PROTECTED] wrote:

   Hello!

 I'm currently creating the software design for a large application
 which we are going to build using Flex 3, Cairngorm 2.2.1 and SabreAMF
 (PHP). I have already created my first prove of concept, however, I
 have a few issues with Cairngorm's Model Locator.

 1) How can I make sure that unused data gets removed from the Model
 Locator? The simple solution would be to destroy the data that a view
 loaded when the view gets closed. However, we are going to use flexmdi
 and it's quite possible that one or more MDI windows are using the
 same data. The only solution I've come up so far is to make the Model
 Locator aware of which window uses which data. Therefore it could free
 the unused data when no view uses it anymore. Yet, this could be a
 very error-prone solution. Moreover, I would loose the last bit of
 loose coupling. So, I'm not sure if that's a good way to handle this.
 Well, the Model Locator itself is often seen as an anti-pattern as
 well ...

 2) Should I really put everything into _one_ Model Locator? I guess
 there could be quite a large number of public variables. Our
 application will have up to 50 different views and about twice as many
 VO ...

 I'd be really grateful if somebody could enlighten my ;-) or if you
 could give me some tips on how to solve those two problems.

 Thanks in advance for your help.

 Best regards,
 Gerhard