http://qs321.pair.com?node_id=557291

jkva has asked for the wisdom of the Perl Monks concerning the following question:

Friends,

Recently I bought the 1994 edition of the "Gang of Four" Design Patterns book. I've been reading it and it has taught me a lot of things already that I did not know before.

For a project I continually work on to exercise my Perl skills, I am thinking of implementing the following (my methodology might still be way off) :

I'd like to have objects that are in a certain state. When interacted with their state changes and they will call some kind of notification method on themselves. By calling this, let's say, $self->notify(), other objects will recieve this and act accordingly. This should form some kind of response-to-notification event model.

I am not sure how I would implement such in Perl, therefore I would like to lay this before the hive mind that is PerlMonks, and see what your thoughts are on this.

Thanks for reading,

-- jkva

Update :
So far I am thinking that all objects classes are subclasses of a class which has a notify() method, which calls some kind of hub class, which knows about all objects and notifies them, this way there would be some kind "distributed awareness". Just doodling with my mind here, it might be very bad :)