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: Defer model/view preparation  (Read 10049 times)
Sammi
Courseware Beta
Full Member
***
Posts: 45


View Profile Email
« 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
Sammi
Courseware Beta
Full Member
***
Posts: 45


View Profile Email
« Reply #2 on: January 23, 2008, 12:24:46 »

Got it!

This is great. Thank you.

Sammi
Logged
Pages: [1]
Print