Re: Subject and Observer Interfaces

From: Date: Tue, 13 Sep 2005 05:35:38 +0000
Subject: Re: Subject and Observer Interfaces
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-18810@lists.php.net to get a copy of this message
Jeff Moore schrieb: > The problem with the Observer interface is that any class implementing > it is only capable of receiving one kind of notification (update) and > there is no capability to send any additional information. > > The problem with the Subject interface is that it can also only support > one kind of observer. You can extend the interfaces interface MySubject extends Subject { } interface MyObserver extends Observer { } and adapt them to your needs while retaining the possibility to use them with other code that only knows about the original Subject and Observer interfaces. -- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

« previous php.internals (#18810) next »