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: Newbie Flash project starting setup with XML config loading - logic check  (Read 8334 times)
WillyCornbread
Jr. Member
**
Posts: 11


View Profile Email
« on: March 10, 2010, 01:00:58 »

Hi all - I'm just diving in to PureMVC for actionscript projects and I have read through the forums and best practices document. Below is the way I have structured the beginning 'skeleton' of a Flash IDE based project and I was hoping to just get a quick check on whether I'm doing this correctly.

+ In my flash document class I get an instance of the facade and call the startup method passing in the document class itself.

+ My startup command registers a configuration proxy that upon registration retrieves an xml document with configuration settings and exposes these via a typed getter to a 'smart' value object that wraps the xml in typed getters via ex4. and then sends an APPSETTINGS_LOADED notification when done.

+ A PrepApplicationCommand was registered initially with the facade to listen for this notification which is a macrocommand that executes a PrepModel and PrepView command.

+ My PrepModel command will register the proxies that I will need, but not actually load data until explicity requested by the application at a later stage.

+ The PrepViewCommand registers an ApplicationMediator passing in the type document class as the object for mediation. (will eventually register other mediators of course)

Is this a sound beginning to a Flash based application, or have I overlooked something in the basic setup and beginnings?

Thanks in advance for your time...

b
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: March 10, 2010, 01:31:49 »

Sounds about right to me.

-=Cliff>
Logged
WillyCornbread
Jr. Member
**
Posts: 11


View Profile Email
« Reply #2 on: March 10, 2010, 01:54:31 »

Thanks so much - you're activity on the forums and in general with help was a major part of my decision to use this framework. I appreciate the work and attention!

b
Logged
sideDoor
Full Member
***
Posts: 25


View Profile Email
« Reply #3 on: April 16, 2010, 10:45:20 »

Thank you for posting the order of events in your application!

One question about this process however, given that your Macro Command, PrepApplicationCommand, is fired on the APPSETTINGS_LOADED notification, how do you push your Document Class to your ApplicationMediator?  It doesn't appear that the Document Class would be in the body of the  APPSETTINGS_LOADED notification...

Thanks very much!
Logged
WillyCornbread
Jr. Member
**
Posts: 11


View Profile Email
« Reply #4 on: April 17, 2010, 06:12:51 »

Hi -

My document base class 'App' is passed as the body of the notification and handed over to the constructor of the ApplicationMediator.

b
Logged
sideDoor
Full Member
***
Posts: 25


View Profile Email
« Reply #5 on: April 17, 2010, 11:22:04 »

Thanks for replying,

I would just like to understand the flow here because I like the steps of first retrieving your settings and then moving on:  But originally you said:

+ A PrepApplicationCommand was registered initially with the facade to listen for this [APPSETTINGS_LOADED] notification which is a macrocommand that executes a PrepModel and PrepView command.

If I understand correctly, this means that the body of the APPSETTINGS_LOADED notification is carrying the SmartVO of your settings data, and NOT a reference to your App.as [Document Class].  So, given that your PrepApplicationCommand, which is carrying the SettingsVO, is firing your PrepView command, which in turn is registering your ApplicationMediator, from where are you accessing your App.as Document Class?.

Sorry if I'm a little slow...thanks again!
sd
Logged
Pages: [1]
Print