Re: Subject/Observer design pattern in PEAR
| From: | Jan Schneider | Date: | Thu, 22 Jul 2004 11:01:37 +0000 |
| Subject: | Re: Subject/Observer design pattern in PEAR | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32242@lists.php.net to get a copy of this message | ||
Zitat von Hans Lellelid <hans@velum.net>:
Philippe Jausions wrote:I don't think a technical solution is needed for PHP 4. Interfaces are contracts, and while you can force PHP 5 to stick to that contract, you can still can apply this contract to PHP 4 classes. And I think this is what he intended. Jan. -- Do you need professional PHP or Horde consulting? http://horde.org/consulting.phpHans L wrote:This should IMO be proposed as a [PHP5] interface. That's what they're for; obviously PEAR shouldn't care about the internal implementation as it could well differ for every package that implements this pattern. Interfaces will make PEAR code very loosely coupled & IMO will be a great, great thing for PEAR being adopted on a much wider scale AND for playing a more prominent role in PHP code community.Although PHP5 is great for interfaces, this could work just as well for PHP4 packages... Of course the interpreter wouldn't complain as with "implements"...Yeah, I don't really see how this would work with PHP4. You would have to have a class extend your interface (i.e. class w/ empty methods) which will certainly not be possible all of the time: there will be conflicts in class hieriarchy design in PHP4 when you want a particular component to extend an interface *and* a package-specific abstract superclass.