Dbus and FSM's
robert_rawlins at hotmail.com
Fri Feb 15 06:54:58 PST 2008
I'm not totally sure this is the best place to ask this question, however, as my application is relying on dbus more and more as the days pass I thought I would get your opinions on this. You'll have to excuse any naivety in my questions, I only read about this concept this morning.
I find that in certain parts of my application I seem to run a sort of chain of sequential events or a procedure, which at the moment generally involves me invoking the initial method call, then allowing call-backs from services to trigger the method that needs to be called next. For Instance.
I do startProcess()
startProcess() calls back with processStarted()
processStarted() then starts soSomthing()
doSomthing calls back with somthingDone()
somethingDone() then started doAnotherThing()
doAnotherThing() calls back and starts doTheLastThing()
Do you see what I mean? a link of function calls and callbacks which cause a chain reaction and progress the particular element of the application to go through its states. My only gripe with this process at the moment is that it means having lots of functions which don't really 'do' anything or contain any business logic, they simply pass the chain onto the next stage.
Is this normal? After looking around this morning it would seem that a Finite State Machine is designed to manage this kind of process for me, is that correct? if so, are many of you implementing them within your applications? what have you learned from it? is there a better way to do this?
I'd be interested to get your thoughts guys,
Share what Santa brought you
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dbus