----- Original Message ----- 
From: "j301c" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Monday, September 01, 2008 6:56 PM
Subject: [flexcoders] Re: Question about Best Practices for Applications 
with many views using Cairngorm


>I agree that states are probably a much better option than viewstacks
> because they are more dynamic.  I probably will consider doing this as
> I move along for this reason.  I guess I was just wondering if there
> was a better way than using constants in the modellocator to bind what
> state, or selected index, that a component is in.  If I used states, am
> I correct in saying I would still need to have a static variable in the
> modellocator that each views state variable would have to bind to?  I
> am thinking there must be a better way to decouple the view from the
> model in this instance. Thanks, I appreciate this great feedback.

I can't quite follow how your application is put together. Usually the view 
is bound to the model via the modellocator and I don't really see the 
problem with that. I'm not sure what you are doing with the constants in the 
modellocator. The model shouldn't be tracking what is happening in the view.

Basically the view issues events to notify the model of what changes are 
happening and to cue the model to make changes to itself as a result of what 
is going on in the view. The model changes and via binding the view is 
updated.

Paul

> --- In flexcoders@yahoogroups.com, "Justin J. Moses" <[EMAIL PROTECTED]> 
> wrote:
>>
>> For your application, have you considered separating your views within
>> states, and only populate them on the "EnterState" event? You could
>> employ modules that load up on that event, rather than preloading them
>> with components.
>>
>> The advantage of using states is that when your user comes back to
>> opened states, they show themselves as they were left. Although the
>> obvious caveat is the memory they take up (which you'd need to analyse
>> in the Flex Profiler - assuming ur using Flex Builder 3 Pro).
>>
>> You can create the states dynamically, say when your user logs in, to
>> load up the modules that type of user might need.
>>
>
>
>
> ------------------------------------
>
> --
> 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
>
>
>
> 

Reply via email to