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
PureMVC Architects Lounge
Announcements and General Discussion
Topic: State Machine??? (Read 3809 times)
April 29, 2009, 12:56:41 »
So I have a Flex application that will have up to 1100 items on screen at all times (zoomable) and for right now they are all static, meaning once on screen they won't change. But, in the release we need to have each of the object be dynamic, meaning that depending on the VO they are passed they need to update their color, size, shape, and position on the stage. Some may even disappear be removed all together and some new ones added depending on the data thats pushed in. The user will also be able to drag the items to different positions on the screen.
Also in the next release, when the user leaves the app, I need to save the state of each of the 1100 items (their position on the stage, color, shape, size, etc...).
So I am thinking local shared object, but do I or can implement the PureMVC StateMachine? Or is their a better way to do this?
Also I am using the Single Version of PureMVC.
Re: State Machine???
Reply #1 on:
May 12, 2009, 05:50:18 »
From your description, I'm not sure how local shared object comes into play.
But I will say, go to MultiCore before you start. Standard is now just a reference for languages that don't support modularity and as well, the natural place for newbies to learn.
Not that there's anything wrong with the Standard version, but once you learn the Standard Version, MultiCore is not that different, and your apps have the ability to become modular on any given day - without migration. Note, you don't have to use modules, pipes or fabrication to use MultiCore the same way you're using Standard now.
As for many objects on the screen each with their own size, check out the HelloFlash demo, this may help you.
As for StateMachine, it is generally for application-wide state, although if each of those objects on the screen were a module/core and needed it's own discrete state machine independent from the rest of the application, then MultiCore with StateMachine would be a good answer. Each core is its own PureMVC app, and as such can run its own StateMachine, having it's own State independent from the everything else.
The 'State' of an object in terms of a Finite State Machine is not so much a collection of properties such as color and size. It's more like 'starting' or 'saving' or 'displayingMenu'. We define discrete State names that an app or core can be in and the valid transitions between them.
So from your description here, I think that a study of HelloFlash would actually be more useful to you than StateMachine to start. Particularly look at HelloSprite and HelloSpriteMediator.
Powered by SMF 2.0.15
SMF © 2006-2007, Simple Machines LLC
Content © 2006-2018, Futurescale, Inc.