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: Domino effect  (Read 11050 times)
Neil Manuell
Courseware Beta
Sr. Member
***
Posts: 109


View Profile Email
« on: January 11, 2009, 06:20:34 »

OK, so this is an experiment that I have been pondering and working on for about six months now.
Its code named Domino, and its function is to enable non linear execution of commands from an external data source.

The main reason I started on this is that in previous complex projects I have had problems managing my command structures, especially those which involved chaining them up.  I wanted to be able to visualise them, so I started drawing diagrams of command processes.

anyhow what i had originally intended (while still maintaining the core idea) has become something else entirely, and the scope of the final project scares me a bit (i'm about 1/100 of the way through it).

I have all the core code functioning, and am busy writing a real world demo (a flick book application for my wife's art project), but I'd like to explain the concept and get your feed back, as I'm not sure if it is just quite an interesting experiment, or if it actually has any real world value.

I appreciate you taking the time to read it:
http://revisual.co.uk/?p=386

cheers

Logged
Ondina
Sr. Member
****
Posts: 86


View Profile Email
« Reply #1 on: April 04, 2009, 04:45:51 »

Neil,

could you elaborate upon your Domino-Effect idea?

I find it interesting, but I'm not sure I understand it.( I've read the article on your blog as well)

I'm wondering if it could be used in combination with the StateMachine.

I haven't implemented StateMachine in my project yet, because I'm waiting for an example, that would clarify my doubts about it.
 
I know, a more “real world” example using StateMachine is on its way.

So until then I'm  trying to define the states of my application and see how many I need, how they are connected or how they would influence each other.

So far it seems that the XML  FSM definition will be huge, due to the fact that my application is really large and complex.

And also there would be a lot going on, back and forth, up and down, because a change of one defined state would trigger changes of other states as well pertaining other parts of my application. A Domino Effect?

But those other parts of my application need to have their own states defined, so they'd be able to change independently as well. That means I can't have just one state definition for different parts.
At least that's how I see it now.

Maybe is a silly question.... but wouldn't it be good if the states would be somehow mapped  or channeled or routed... so when you go from STATE_LOGIN to STATE_LOGGED_IN the “Domino Effect” would take care of the other states of the application, that would have to change one after another?

Hmm..I hope you'll excuse my confusing explanation, I don't know how to describe what I'm envisioning.
Maybe I will be able to be more specific after you tell us more about the DominoEffect and if it is suited to be used together with the StateMachine.

Thank you.
Ondina
Logged

~ Ondina ~
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: April 04, 2009, 08:14:14 »

If you use multicore, you can break your functionality into modules, and have FSMs in the main app/shell as well as all the modules. This solves your problem with the same approach all the way down the rabbit hole(s).

-=Cliff>
Logged
Neil Manuell
Courseware Beta
Sr. Member
***
Posts: 109


View Profile Email
« Reply #3 on: April 04, 2009, 10:02:02 »

Well, as i said, Domino is an experiment at the moment... and one that I have had to put aside at the moment, so I can pay my mortgage :/.

The idea is that it "plugsin" to the StateMachine, and allows a non-linear chain of commands to be executed that is determined by an externally loaded model.

The prototype that I have up and working works well, but its integration with the StateMachine is clumsy (I think cliff's latest changes to the StateMachine will solve these problems when I have a chance to go back to it).  The problem as a whole is that I think it really needs a visual programming type of interface. So its either a massive project, or its pointless.

Also, I think that a visual markup tool for creating the StateMachine definitions (as cliff has suggested had he the time) would be a far more worthwhile and helpful tool in the short term. So I am going to attempt that first. It would also be a good starting block for domino should I continue.

I think that cliff's suggestion, splitting your application into smaller, more manageable modules, each with their own StateMachine is the way to go.

So I guess a StateMachine markup tool needs to build multi-core StateMachine definitions too.
Logged
Ondina
Sr. Member
****
Posts: 86


View Profile Email
« Reply #4 on: April 04, 2009, 12:08:56 »

Thank you both for your advises:)

When I said that my AIR application was huge, I didn't mean that it was one big unmanageable...something.

I use modules, but one of the modules contains a form, a huge one (cough).
Actually there are about 25 forms in a ViewStack, each in its own View or in another nested ViewStack, but in the end, when the user presses the save button I have to collect the data from all the forms and send it to the server.
Some of the forms, even if they are part of that big form, have a life of their own, meaning their data has to be saved separately dependent on various states of the application. Or, for example, the incoming data has different sources ( from searching the database and filling the form from a DataGrid selected item, from a feed, from user input, etc), that I need to know about, so different actions would follow.
 
When I started the project I had those ~25 forms designed as separate modules. I don't want to bore you with details about the reasons that made me change the modules belonging to that form into “normal” Flex components. Anyway those subforms keep having a modular behavior, that's why refactoring my code with puremvc is in fact pretty easy and most of its functionality has already passed the tests.

StateMachine is actually very straightforward, but I have no idea why it is  still difficult for me to implement it in my project.
I guess I'll have to wait for the promised StateMachine example to be able to use it efficiently.
And I'll search the forum for that “StateMachine markup tool “ you mentioned, because I don't know what you're referring to.

Ondina
Logged

~ Ondina ~
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 on: April 04, 2009, 12:16:26 »

The tool to which Neil is referring is as yet notional. Something I suggested would be an awesome compliment to the StateMachine and help to make the size of the FSM definition less of a concern since it would be managed by middleware.

-=Cliff>
Logged
Pages: [1]
Print