I have done quite a bit of work with Modules and an MVC stylee framework named PureMVC. I have just posted a new example of a module loading application within this framework using ModuleBase as opposed to mxml Modules which may be of some interest:

http://www.nutrixinteractive.com/blog/?p=136

Check em out,

Simon

newtriks.com

On 25 Aug 2008, at 18:37, Richard Rodseth wrote:


I'm not sure how much this is a Flex question, as opposed to an MVC design question about approaches to composing MVC and where to put view factories.

I've successfully built pseudo-modules which instantiate a model, view and controller triplet in MXML. I've also nested this pattern. But in these cases, all views of the module were contained within the module itself, if you know what I mean, so the fact that the (pseudo) module was a UIComponent was fine.

However, if a conceptual module defines several views which don't get laid out in a common container (well, other than the application), questions arise as to where the view factories belong. Make the module an invisible component which instantiates a model and can spawn MVC triplets with that common model on demand? Let the module represent one "main" view, but still with the ability to spawn others? Make the module itself a non-UI entity, and store a collection of them as part of the application model, independent of UI layout?

In Flex, Modules are UIComponents, but I see that ModuleBase is also available, so I know if I go with something like the last-mentioned approach, I won't be stuck if I need to convert to actual Flex modules at some point.

Comments?



Reply via email to