PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: Elephant on April 15, 2008, 10:09:22



Title: Dynamic View Creation/Destruction
Post by: Elephant on April 15, 2008, 10:09:22
Hello,

I'm working on an app that uses a viewstack to manage multiple views.  Each view plays a background SWF (either static image or short video) and some audio.  Most of the views involve extensive interaction with the user.

With the number of views that get activated as we step through the app, we're consuming lots of memory.  To ameliorate that, we'd like to expire/unload views as the user finishes them, then reload them again when they're needed.  One thought we've had is to create all the views as separate SWFs that throw appropriate events and expose a simple API for setting any necessary data, then manage them from a Mediator.

We have a linear path through the application, so we can easily use a generational model for view components:

Parent:  Current view
Child:  Preloading resources for the next view

However, from what I've read, neither the viewstack nor view states really fit this type of model.  Does anyone have some thoughts on how this could be arranged to mesh easily with the PureMVC structure?


Title: Re: Dynamic View Creation/Destruction
Post by: trilec on April 17, 2008, 05:06:34
Elephant ,
if you are considering each SWF as a module within itself perhaps the multicore version may help in this situation.The stage may be considered the main core and each "View SWF module" additional cores.

If you are new to pureMVC this may appear a little daunting and it may help reviewing other posts on "Modularity" If you do decide to investigate this further

T