Re: Re: PHP 5.1 CVS Interface Question

From: Date: Thu, 03 Mar 2005 15:26:35 +0000
Subject: Re: Re: PHP 5.1 CVS Interface Question
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-209924@lists.php.net to get a copy of this message
Gavin Roy wrote:
Stolen from a oo reference site (who's URL I no longer have handy): "An object interface--or simply interface--defines methods that can be implemented by a class. Interfaces are declared like classes, but cannot be directly instantiated and do not have their own method definitions. Rather, it is the responsibility of any class that supports an interface to provide implementations for the interface's methods. A variable of an interface type can reference an object whose class implements that interface; however, only methods declared in the interface can be called using such a variable." That goes with my understanding as interfaces being one more level of abstraction from abstract classes. That is they define the rules for the classes that implement them, but not any code (where an abstract class can implement code). I guess my understanding of an interface is wrong?
no not really - only the PHP devs have a particular view of what an interface should be / how it should be used. other groups have different views. personally I don't _think_ you are using a 'good' paradigm for you class heirachy - but its impossible to tell for sure - I'd have to see much more code :-) btw: if you drop the 'static' from the interface definition and from the class definitions (of the interface) you can still use/call the methods statically... ...

« previous php.general (#209924) next »