0 Replies Latest reply on Apr 13, 2009 3:48 AM by _FlexFlip

    Cairngorm, Presentation Model and Modules

      The last days I have been looking into using Modules in a Cairngorm project using the Presentation Model.


      I have the following general setup:


      + Application.mxml



          +AppModelLocator > defines DomainModel and MainViewPresentationModel


          +MainView > bound to the MainViewPresentationModel


      The main-view defines navigation and a content area:


      MainViewPresentationModel > defines NavViewPresentationModel and ContentViewPresentationModel



      +NavView (bound to NavViewPresentationModel)

      +ContentView  (bound to ContentViewPresentationModel)


      What I would like to do is load modules into the ContentView representing different types of content (sections).


      I would like all data to be stored in the DomainModel. For the rest, each section could be standalone, although it still needs to be able to communicate with the main application.


      Some of the questions that came up, and I do not have found a good answer for are:

      1. how to setup the PresentationModel for the individual modules;
      2. how to pass on the DomainModel to the individual modules/their presentation views;
      3. how should I setup my project: all modules are part of the main Flex project, or create individual Flex projects for each module;
      4. if the latter, how to do that so that the indidual module projects are still optimised for the main Flex project's application;


      I have googled around and found many solutions that solve parts of these problems, but none that gave a consise answer to the implementation of modles in Cairngorm using the Presentation Model.


      Any pointers are much appreciated.