Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: September 19, 2007, 10:23:11
Unfortunatly, I don't think you can have a module switch between Module/Application at runtime because each inherits from a different base class =(.  If you try to run the module as a stand alone app I think it just gives you a grey screen.  From what I have seen you can replace <mx:Module/> with <mx:Application/> and it works pretty well. That's how I was originally testing my modules before I realized I could debug modules by loading the <moduleName>-debug.swf instead of the <moduleName>.swf from my main application.
2  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: September 18, 2007, 07:02:31
Eureaka! I got the cross-Module communication functionality working =) In my first example above, I had two modules that were loaded with their own independent ApplicationFacade. They each register their own command, but can't communicate in a cross-modular fassion. If I added an ApplicationFacade to the main app, all sorts of scoping issues came into play =P

Evidently this is similar to what happens when you try to marry Cairngorm + Modules as well because of the Singleton pattern being used.  In order to accomplish cross-module communication I used a technique that makes modules play nice with Cairngorm found here:

http://blog.digitalmaelstrom.net/2007/04/cairngorm-modules-trouble.html

For this new demo, I am able to get two modules loaded, each registering their own seperate commands. Each is now able to dispatch those commands in a cross-modular fassion using a centralized ApplicationFacade that was registered to each module upon creation.  This should really help someone out who wants to have an application that will be loading modules dynamically at runtime.

The key was the interface that lets my Modules be "Pure MVC Aware": IPureMVCAware. It basically forces a PureMVC aware module to implement the register/unregister functions upon load/unload from the main Application. I need to dig a bit deeper into getting Views/Models included into a demo as well as implement some cleaner unregister code, but for now this shows you how to send commands in a cross module fassion.
3  PureMVC Manifold / MultiCore Version / PureMVC + Modules on: August 30, 2007, 12:14:23
There isn't really a lot of documentation on integrating PureMVC with Flex Modules so I thought I would post on these forums. (see attached for source)

The code that is included is based off Vic on Flex's Cairngorm + Modules example found here:

http://viconflex.blogspot.com/2007/05/can-cairngorm-and-modules-play-nice_12.html

This example is implemented using PureMVC and demonstrates how to use a "shell application" to load Modules that have been implemented using the PureMVC framework. It doesn't do anything fancy, but gives someone a good place to start when trying to dynamically link in PureMVC based modules into a Flex application.

The key to this example is that you can't reference the ApplicationFacade in the main application.  I had issues trying to load an ApplicationFacade in the root app and then have each module load it's own ApplicationFacade or register Notifications to either facade. There is something interesting going on with the Singleton pattern and how the main application -> modules scope is being handled.

I am going to start working on a more elegant solution that allows cross-module notifications but for the time being, this should get people started on the road to using Modules built on the PureMVC framework.
4  Announcements and General Discussion / Getting Started / Re: Architecture 101 Course - Interested in testing? on: August 27, 2007, 01:48:37
I just finished a working version of the 101 Course and can say that it helped me get up to speed on the PureMVC framework very rapidly. Cliff's examples walk you from the baby step of creating an ApplicationFacade to full blown multi-application code sharing using Command chains on initialization. Awesome work so far Cliff!

   -rOck
Pages: [1]