PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: Sammi on January 22, 2008, 03:22:05



Title: Defer model/view preparation
Post by: Sammi on January 22, 2008, 03:22:05
Hi,

I am risking being taken for a silly guy - but I don't mind bacause I am.

I have been going over quite a few examples of PureMVC implementation and I can see that the usual PrepModel/PrepView commands seem to be used in Flex apps - but not in regular AS3 apps.

Is that because of the way Flex works?  Should I just register Proxys and Mediators in the Facade for simple apps? Or just in my StartupCommand?

Sorry about this silly question.

Best,
Sammi


Title: Re: Defer model/view preparation
Post by: puremvc on January 22, 2008, 06:13:12
Sammi,

Heed the warnings in the Facade API docs about attempting to register Mediators and Proxies inside the Facade.

A startup command is the recommended way to register proxies and mediators.

If it is a simple app the single command can do the work.

However you might want to have multiple applications reuse the same model.

In this case package the model sepaarately (com.me.common.model) and include a ModelPrepCommand (com.me.multiapp.common.controller). Then have your app's StartupCommand (com.me.me.multiapp.app1.controller) me a macro command that runs the common ModelPrepCommand followed by a local ViewPrepCommand.

-=Cliff>


Title: Re: Defer model/view preparation
Post by: Sammi on January 23, 2008, 12:24:46
Got it!

This is great. Thank you.

Sammi