[dev] Observer

Carlos Pedrinaci cpedrinaci at yahoo.es
Mon Oct 18 16:27:01 PDT 2004


Hi,

I have been seeking for some way for supporting automatic notification
of changes between different objects across different modules.
It seemed to me that the Relationship stuff could fit there well.
I had a look at it, and decided to implement the Observer pattern in a
generic way from scratch. The result is something in between the
Relationship and the Notification. 

Attached is the file where I have implemented that. It has not been
tested and is more or less the skeleton.. It's just for the sake of
discussion.

Now the question is what's the use of that stuff?

Whups has very nice mailing functionality which would certainly be
interesting for other apps. (For instance Thor, Agora, perhaps Nic..)

The Observer thing could be applied for providing that kind of
functionnality to these other apps by just moving the Mailing
functionnality of Whups to another place (another app?) Every user would
then be able establish watches over different objects using the
Observers thing.

Another interesting application of that, is for Thor <-> Whups
interaction:

I plan to support Project Plans schedulling which will transform the
Project Plan into a set of Whups tickets. If each and every project is
schedulled and all the tickets are generated, what was intended to be
improvement for work organisation becomes a real inconvenient.

Instead my idea is to support linking Tickets back into Thor through
this Observers implementation. That way whenever a task is finished all
these tasks that can now be started ('End-Start' relationships for
example) would then be generated... 

Take a look at it (if you get sometime) and let me know what you think.
Of course, simpler solutions are more than welcome :)

Carlos

PS: I'm really sorry for that long mail..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Observer.php
Type: application/x-php
Size: 8486 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20041019/0407dd44/Observer-0003.bin


More information about the dev mailing list