Dbus and FSM's

Robert Rawlins robert_rawlins at hotmail.com
Fri Feb 15 06:54:58 PST 2008


Afternoon Everyone,
 
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,
 
Robert
_________________________________________________________________
Share what Santa brought you
https://www.mycooluncool.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080215/436d44dc/attachment.htm 


More information about the dbus mailing list