Re: RfC: rethink OO inheritance strictness

From: Date: Mon, 24 Jul 2006 14:32:17 +0000
Subject: Re: RfC: rethink OO inheritance strictness
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-24928@lists.php.net to get a copy of this message
Andi Gutmans wrote:
For constructors it actually makes sense because at the time of instantiaton, you know what the concrete class is. It is very common for constructors to be very much different in polymorphic classes.
What about factory methods? It makes sense there too. I could also imagine a base framework which provides very generic independent classes which are never directly used. An application only using specialized instances could well profit from simplifying some of the parameter lists. Less obvious and sneered at by many people I'm sure but... ... with my main point being that I'd rather have PHP stay too loose than getting to strict about what's right and what's wrong. And as someone already pointed out PHP 5 already provides a tool enforce an interface: Interfaces and abstract classes. - Chris

« previous php.internals (#24928) next »