Re: simple interface standard?
| From: | Philippe Jausions | Date: | Mon, 30 Aug 2004 13:05:59 +0000 |
| Subject: | Re: simple interface standard? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33056@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Philippe Jausions wrote:IMHO, the main reason to define interfaces withing a package is to do polymorphism, and it is a very good reason. Everything under a package is pretty much controlled by the package itself. Adding a driver could be done without declaration of an interface, unless that driver could also be used by another package, but then again, the interface should be declared outside the package to be independent of implementations....IMHO, having an interface under a specific package doesn't necessarily make sense as the interface is to be "shared" between packages. If you need to implement an interface you don't necessary want to get the whole package.Well there Interfaces that define an entire category. For example if we end up having a Template category we are likely to also define a (set) of Interfaces for this category. Other Interfaces are defined within a package. For example to define a driver/container.
As for the name, the full "Interace" name is preferable to the "I" abbreviation. For several reasons: - if jammed with the name of the interface it's not easy to spot. - Making it stand as _I_ somewhere in the name is not really clear as well. Not everybody is used to that abbreviation. Whereas "_E_" for the exception class is very well suited as every PHP programmer know about the somewhat related error reporting level constants E_*. - Implementing an interface is not that frequent relatively to the size of a application. Same that above, whereas frequency justifies abbreviation for Exception, I don't see it happening for inerfaces...I also agree that we should go with the full "Interface". regards, Lukas