Re: Re: Subject/Observer design pattern in PEAR

From: Date: Fri, 23 Jul 2004 05:33:13 +0000
Subject: Re: Re: Subject/Observer design pattern in PEAR
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32262@lists.php.net to get a copy of this message
On Thu Jul 22, 2004 at 02:1039PM +0200, Heino H. Gehlsen wrote: > Op perhaps there should simply only be one interface package, Interface or > even better PEAR_Interface, which includes one file per category (either in > the root or in the PEAR directory). This way mail related interfaces would > be found in either /Mail.php or /PEAR/Mail.php and so on. I don't think they should end up in the those directories; for the sake of tidiness I'd suggest to put interfaces into something like /usr/share/pear/Interface/*.php. > > I agree -- definitely classhints would be the way to go here. That's > > really the nice thing about using interfaces with PHP5. > > So do I, but I'm not sure if it's time to use them yet. (?) I don't see a problem with using them. > Personally I don't care much wether the methods are called > (detach|attach)Observer or (add|delete)Observer, but the notity method > should definately be called notifyObservers if the other methods ends with > Observer! We should probably opt for something like similar to the method names in java.util.Observable: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Observable.html#method_summary Personally I like this syntax a lot and using the same method names makes it easy for people knowing Java to adopt the PHP interfaces. -- - Martin Martin Jansen http://martinjansen.com/

« previous php.pear.dev (#32262) next »