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: slacker example initialize model approach  (Read 8837 times)
f_tamy9
Newbie
*
Posts: 6


View Profile Email
« on: August 21, 2008, 07:49:18 »

  I'd just started the AS3 and flex with pureMVC last week.
  I did not get the idea of missing the Slacker Model on : http://trac.puremvc.org/Demo_AS3_Flex_Slacker/browser/trunk/src/org/puremvc/as3/demos/flex/slacker/model
  I read on release note about the Mode on:
1. The Main MXML Application (Slacker) gets the ApplicationFacade instance *during* its creation.

2. This initializes the Model, View, Controller and Facade instances, and registers STARTUP/StartupCommand with the controller.
  How Slacker initializes the model?

  I did not find the proper place for registerProxy calls. Shall we do it in StartupCommand or else?
Thank you in advanced.  :)
Logged
danielcsgomes
Full Member
***
Posts: 47

 - daniel@onedesign.com.pt
View Profile Email
« Reply #1 on: August 21, 2008, 08:04:36 »

Hi f_tamy9,

Yes, you should initialize the model in the StartupCommad, this example doesn't have Model because it is about of handling Deferred Instantiation.

Daniel Gomes
Logged
f_tamy9
Newbie
*
Posts: 6


View Profile Email
« Reply #2 on: August 22, 2008, 10:56:28 »

Hello Daniel Gomes
  Thanks for your comment!  :D
  In my opinion it is better to add a proxy to load some stuff (e.g. a few images) to show Deferred Instantiation in a clear manner.

Regards, F.Tamy
Logged
danielcsgomes
Full Member
***
Posts: 47

 - daniel@onedesign.com.pt
View Profile Email
« Reply #3 on: August 23, 2008, 01:14:18 »

Hi Tamy,

Take a look on the demo i created, it handles with Deferred Instantiation and handle it in a different way. see it on this post:
http://forums.puremvc.org/index.php?topic=639.0

Today i will post the link with the all source files (database,php,as3 e mxml).

Daniel Gomes
« Last Edit: August 23, 2008, 03:03:35 by danielcsgomes » Logged
f_tamy9
Newbie
*
Posts: 6


View Profile Email
« Reply #4 on: August 23, 2008, 08:46:58 »

It is a cute example Daniel!  :)
We did the same via a SWF document class.

F.Tamy
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 on: August 23, 2008, 09:45:47 »

Hi Folks,

This example is focused on deferred instantiation within the View.

The Model should be initialized first, but it should not make any eager remote calls that will require the View to be prepared and ready when they return.

Thus the natural extension of this is that the Model be prepared, then the View, followed by any Commands that require both to be in place, such as causing Remote Proxies to fetch their data and subsequently populate the View by Notification.

Although the demo would be more complete if it did this, it would be much more rambling than the existing one. I was thinking this morning, about this very problem, and thinking perhaps of turning it into a tutorial, with the steps you need to extend it to do some typical but simple work with the Model. If I get time for this I will try to work it in.

-=Cliff>
Logged
f_tamy9
Newbie
*
Posts: 6


View Profile Email
« Reply #6 on: August 26, 2008, 10:32:17 »

Thanks Cliff!
  If I got your idea clearly, model should initialized first with few constant hard coded data. ???
  Preparing a tutorial is necessary for extending the Slacker if you could do it.  Do your best please.
Cheers,  :D
F.Tamy
Logged
Pages: [1]
Print