PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: Helmut Granda on June 22, 2009, 01:52:17



Title: StateMachine Sample Door
Post by: Helmut Granda on June 22, 2009, 01:52:17
In the statemachine presentation in puremvc.org there is the mention of a door handle as an application to this concept. Is there source code for such application out there?
      
There reason why I am asking is because I don't know where to start in regards to the instatiation of the class. Granted the presentations go in great detail on where to place the XML and how to declare your states but the basics of where do you instatiate the class are left behind.
      
I apologize for those who seem this request rather absurd or noobish. There are some of use out there who would greatly benefit from this information. Just right now I am working on a project where I need to save the state of the application and I would like to use the StateMachine but I am not sure where to place it.
      


Title: Re: StateMachine Sample Door
Post by: puremvc on June 28, 2009, 09:00:06
There is no implementation of the Lockable Door described in the presentation, it was for illustrative purposes only. The overview presentations are necessarily abstract because the framework and the utilities exist in more than one language. Have a look at the StopWatch demo for an example of how and where to configure and inject your StateMachine. Note that it has not been updated to make use of entry and exit guards. It's just simple transitioning between states.

Stopwatch Demo:
http://trac.puremvc.org/Demo_AS3_Flex_StopWatch

A recent article on using the StateMachine from Joel Hooks:
http://joelhooks.com/2009/05/18/piping-the-machine-puremvc-multicore-with-pipes-and-the-finite-state-machine-fsm/

You can also have a look at the original source code for the Sea of Arrows site here:
http://seaofarrows.com/srcview

It's all been abstracted to a library and the visualization module refined so it's not exactly what's running now, but the StateMachine stuff is in the Shell package, and is just as described in the Getting in the Groove presentation on PureMVC TV.

-=Cliff>