Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Implementing an event-driven object model in Perl

by Moron (Curate)
on Jun 27, 2006 at 11:26 UTC ( [id://557765]=note: print w/replies, xml ) Need Help??


in reply to Implementing an event-driven object model in Perl

I don't understand why other objects should receive notification of a state change unless you really mean that there is a unique state for the class. But if so, then you should want to avoid duplicating the information and instead use a separate class for aggregate information. For example, suppose we are making a route finder or solving the TSP with such an object model, in which our objects are nodes in a network and trial routes exploring the network which collapse whenever they meet each other and spawn children at each node to explore each possible direction to take. A node will have one of three states which are caused by the progress of the trial routes: untouched, touched, established and eliminated. So we would find it much more efficient to store that state in the node object, not in every single trial route object that has been through the node, even though it is the progress of the trial routes that caused the node state to change.

-M

Free your mind

  • Comment on Re: Implementing an event-driven object model in Perl

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (None)
    As of 2024-04-25 00:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found