Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by salva (Canon)
on Jun 01, 2013 at 11:38 UTC ( [id://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)

Replies are listed 'Best First'.
Re^10: a State machine with Roles - possible? (class or instance)
by LanX (Saint) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1036424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found