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
|
|
|
Show Posts
|
Pages: 1 2 [3] 4
|
33
|
Announcements and General Discussion / Architecture / FInal State Machine..need feedback on FSM definition for videoplayer
|
on: September 06, 2009, 07:42:32
|
This is what I have so far, unless I'm mistaken I don't see the need for any entering or exiting guards. Can anyone suggest whether I'm on the right track?
//CODE START <fsm initial={Main.STATE_READY}> <state name={Main.STATE_READY} > <transition action={Main.ACTION_START} target={Main.STATE_PLAYING}/> </state> <state name={Main.STATE_PLAYING} > <transition action={Main.ACTION_PAUSE} target={Main.STATE_PAUSED}/> <transition action={Main.ACTION_STOP} target={Main.STATE_STOPPED}/> </state> <state name={Main.STATE_PAUSED} > <transition action={Main.ACTION_RESUME} target={Main.STATE_PLAYING}/> </state> <state name={Main.STATE_STOPPED}> <transition action={Main.ACTION_RESET} target={Main.STATE_READY}/> </state> </fsm>;
//CODE END
and then in my ApplicationFacade
//CODE START override protected function initializeController () : void { super.initializeController(); registerCommand( STARTUP, StartupCommand ); registerCommand( Main.ACTION_RESET, ReadyCommand ); registerCommand( Main.ACTION_START, PlayCommand ); registerCommand( Main.ACTION_STOP, StopCommand ); registerCommand( Main.ACTION_PAUSE, PauseCommand ); registerCommand( Main.ACTION_RESUME, PlayCommand ); } //CODE END
|
|
|
35
|
Announcements and General Discussion / Architecture / Q; State pattern to represent 'logged IN' and 'logged OUT' ??
|
on: August 31, 2009, 05:56:08
|
I've built an application that has a number of sequentially viewed steps (my view components) and also also allows the user to be either 'loggedIN' or loggedOUT' while navigating from step to step.
Chapter 10 of the excellent 'HeadFirst DesignPatterns' describes the State Pattern as 'encapsulating state-based behaviour and delegate behaviour to the current state'
I'm thinking that being 'logged IN' or 'logged OUT' represent 2 discreet states and perhaps I should be implementing the state pattern (ie the FinalStateMachine) BUT, the behaviour of my application doesn't change on logged IN or OUT, only the appearance changes.
Can anyone share their rationale and or examples in using the State machine and-or help clarify the above?
|
|
|
38
|
Announcements and General Discussion / Architecture / Q:Passing queryString values into application on startup
|
on: August 19, 2009, 08:59:08
|
I have a queerystring utility class I'm instantiating from my main class.
If there are querystring key value pairs associated with the url that loads the application, I need to feed them into the application as they will determine what my application does on startup.
My question is, what is the best practice for doing this in PureMVC app?
Should I pass any query string variables into my ApplicationFacade startup method and then make them part of the first STARTUP notification?
|
|
|
39
|
Announcements and General Discussion / General Discussion / Q: Best practice, where to store constants?
|
on: August 10, 2009, 06:04:51
|
Constants used by notifications that are mapped to commands, and might be used by more than one mediator, I store in the Appplication Facade.
Other constants NOT mapped to any commands, I keep in the relevant view component. The latter would be used in both events dispatched by the component as well as the component's mediator.
Can anyone share their rationale for storing public constants and-or provide feedback on whether the above is recommended?
|
|
|
42
|
Announcements and General Discussion / General Discussion / Using implicit getters in concrete mediators
|
on: July 29, 2009, 05:24:48
|
p35 of the best practices document http://puremvc.org/component/option,com_wrapper/Itemid,30/If I try duplicating the example, using the following in my LoginPanelMediator, loginPanel traces null. Also, shouldn't viewComponent in the implicit getter reference the Main class , passed in thru the body of the StartUpCommand? //CODE START // User clicked Login Button; try to log in private function onTryLogin ( event:Event ) : void { trace('loginPanel==='+loginPanel);//traces null sendNotification( ApplicationFacade.LOGIN, loginPanel.loginVO ); } // Cast the viewComponent to its actual type. protected function get loginPanel() : LoginPanel { return viewComponent as LoginPanel; } //CODE END
|
|
|
43
|
Announcements and General Discussion / Getting Started / Q:Communicating state between different proxies at runtime
|
on: July 23, 2009, 06:26:45
|
Hi This is related to the cross-referencing proxies post but not quite the same issue I believe. I am also a novice PureMVC'er so for my first app want to avoid using StartupManager or any other PureMVC utlities.
I have 3 proxies, 2 that handle uploading and saving of images to a remote server, and a third that manages user login, registration as well as current application 'states' defined as static constants.
My 2 'image' proxies need to communicate their 'state' to the UserProxy. Would the simplest solution and best practice be to simply define a 'SiteProxy' which all 3 proxies extend? And to define my static 'state' constants in this SiteProxy so that ALL proxies know about them? Or should my existing proxies retrieve an instance of each other via the facade?
|
|
|
44
|
Announcements and General Discussion / Architecture / Tracking implementation
|
on: July 22, 2009, 04:17:02
|
In several projects I have worked on tracking logic has been requested by the client AFTER the site went live, ie tracking was never part of the original functional spec. By tracking I mean all user interaction such as button clicks, form entries, and, if the site is composed of subsections, sections viewed, as well as client specific hardware-software data accessible via the Flash api. For instance Google Analytics http://www.insideria.com/2009/02/using-google-analytics-within.htmlCan someone tell me if tracking can be easily implemented in a PureMVC application AFTER the project is complete, and if so, would any of the original 'actors'(proxies, mediators, controllers) have to be modified, or would they be supplemented with additonal actors? For example, I assume it would make sense to have an additonal 'TrackingProxy' but not sure if existing mediators would need to be modified or if there was some other way.
|
|
|
|
|
|