Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^9: a State machine with Roles - possible? (class or instance)

by salva (Monsignor)
on Jun 01, 2013 at 11:38 UTC ( #1036424=note: print w/ replies, xml ) Need Help??


in reply to Re^8: a State machine with Roles - possible? (class or instance)
in thread a State machine with Roles - possible?

Yes, a real common example is, on an event-based application, an object that has to do two (or more) things at the same time. For instance accessing a network service while tracking and external process or accessing a database.

You may be able to delegate most of the work needed to perform the subtasks to other objects (which would be unidimensional state machines). But there would be a point where you have to handle the interaction between them using a multidimensional state machine.

In any case, note that a multidimensional state machine can be converted into a unidimensional one if you flatten the state matrix using the cartesian product, or in practice, if you are able to organize the states in a tree (usually not all the multidimensional states may happen).


Comment on Re^9: a State machine with Roles - possible? (class or instance)
Re^10: a State machine with Roles - possible? (class or instance)
by LanX (Canon) on Jun 01, 2013 at 12:02 UTC
    Thanks! =)

    > You may be able to delegate most of the work needed to perform the subtasks to other objects (which would be unidimensional state machines).

    This would be my first choice.

    The main object has attributes referencing the state objects.

    > But there would be a point where you have to handle the interaction between them using a multidimensional state machine.

    Thats where I would use "proxy"/wrapper methods in the class of the main object.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-08-30 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls