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

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / StateMachine Global Transitions on: February 07, 2010, 04:41:15
Hi all,

I stumbled upon a use case where a global transition in the StateMachine would be useful, but I think there's no way to implement it right now other than hardcoding the same transition to each and every state individually.

For example, if I have an "APPLICATION_EXCEPTION" state, to which I want to be able to make a transition from all states.

I'd like to know if there's a way to do it which I am missing, and if there's no way to do it, it might be useful in an upcoming version...

Thanks,
Oren
2  Announcements and General Discussion / Architecture / StateMachine Action Notification Chains Problem on: February 02, 2010, 03:29:07
Hi all,

I am using the StateMachine, and have the following setup:

:
<fsm initial="INITING">
   <state name="INITING"}>
   <transition action="INIT_DONE" target="MODULE_INITING"/>
   </state>
   <state name="MODULE_INITING" changed="CHANGED_MODULE_INITING">
   <transition action="MODULE_INIT_DONE" target="MODULE_PLAYING"/>
   </state>
   <state name="MODULE_PLAYING" changed="CHANGED_MODULE_PLAYING">
   </state>
</fsm>

Now, I have a mediator that is interested in both CHANGED_MODULE_INITING and CHANGED_MODULE_PLAYING. The problem is that my ChangedModuleInitingCommand initiates the transition to MODULE_PLAYING by sending a notification of CHANGE and type MODULE_INIT_DONE, but then the mediator gets the CHANGED notifications in LIFO order, so it is actually in INITING state while it should be in PLAYING state.

I assume the problem is the timing of the call to action MODULE_INIT_DONE, but as I have read in the release notes, the specific-state change is where you should initiate calls to other actions.

So any idea what I am doing wrong and how to solve this?

Thanks,
Oren
3  Announcements and General Discussion / Architecture / Managing View States with StateMachine on: February 02, 2010, 12:24:47
Hi all,

I have just started out coding as3 using PureMVC, and it's brilliant!

I have a question regarding the StateMachine. I wanted to know what is the best practice of hiding view components which are not needed in a state. I thought about the following options:

1. Have each view component mediator interested in all specific-state-changed notifications, and by default (literally, in the "default" section of the switch in handleNotification) hide its component.

2. Have each view component mediator interested in the global StateMachine.CHANGED notification, and examine its value when received. It should then by default hide its view component, or show it if the state dictates showing it.

Both methods, however, seem cumbersome. I wanted to know if there's a recommended way to handle this.

Thanks,
Oren
Pages: [1]