Re: Subject and Observer Interfaces

From: Date: Tue, 13 Sep 2005 14:42:34 +0000
Subject: Re: Subject and Observer Interfaces
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-18830@lists.php.net to get a copy of this message
On Sep 13, 2005, at 1:35 AM, Sebastian Bergmann wrote:
You can extend the interfaces ... 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.
Actually you can't and still be typesafe. If I extend Observer and add a changed() method, I cannot pass that new object to a standard Subject interface because that interface has no business calling the changed() method since its not on the base Observer interface that it specified. There are other problems. The two interfaces are tightly coupled and extensions are not interoperable and thats why I think they aren't generic enough to be a standard base class in PHP.

« previous php.internals (#18830) next »