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

Pages: [1]
Print
Author Topic: How to convert apps to fabrication modules?  (Read 10315 times)
marks416
Sr. Member
****
Posts: 52


View Profile Email
« on: January 20, 2009, 12:12:18 »

Hi,

I have developed two applications with fabrication.

I plan to covert the two fabrication apps to two fabrication modules and use shell to integrate two modules.
I also need route message between the two module.

Do you think if it is possible? Can you give us some advice how to do this.

Thanks a lot

Mark
Logged
marks416
Sr. Member
****
Posts: 52


View Profile Email
« Reply #1 on: January 21, 2009, 09:13:37 »

Hi Darshan,

I like use fabrication,Please help me for this.

I look for a common way to do the kind of work(convert fab apps to fab modules).

Thanks

Mark
Logged
Darshan Sawardekar
Sr. Member
****
Posts: 85


View Profile Email
« Reply #2 on: January 22, 2009, 12:05:40 »

Hey Mark,

To Convert Applications to modules means changing the base class of your main application from FlexModule to FlexApplication. The shell application would load the FlexModules with the FlexModuleLoader.

:
var moduleLoader:FlexModuleLoader = new FlexModuleLoader();

moduleLoader.url = "moduleX.swf";
moduleLoader.router = applicationRouter;

addChild(moduleLoader);

For sending messages between the modules you can use the routeNotification method available throughout Fabrication's commands, mediators, etc. If your modules are called ModuleX and ModuleY. You can send messages to and from using routeNotification as,

:
// module X to Y
routeNotification("myNote", myBody, "myType", "ModuleX/*");

// module Y to X
routeNotification("myNote", myBody, "myType", "ModuleY/*");

// shell to both X or Y
routeNotification("myNote", myBody, "myType", "*");

There are some other considerations when switching between applications to modules if you are using Flex 3.2+ to do with the Marshall plan. This mostly to do with how you subscribe to system events and such.

I suggest taking a look at the Example applications like simple_routing. Hope that helps.

peace,
darshan
Logged
Pages: [1]
Print