Re: Interface naming standards?

From: Date: Thu, 01 Jun 2006 16:46:20 +0000
Subject: Re: Interface naming standards?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42723@lists.php.net to get a copy of this message
On 6/1/06, Joe Stump <jstump@enotes.com> wrote:
I'm currently working on a package that I plan on having an interface defined in. The CS docs are completely void on the subject of naming interfaces and, before I go coding my interface, I'd like to hear a bit from the list about the subject ... 1.) In the PHP manual they use iFoo (the "i" for interface)
Bah! That means that the file sorts differently, making visual grouping ugly.
2.) Maybe Interface_Foo?
Same thing.
3.) Name it whatever I please, which means there's no indication that it's an interface?
No, use the word Interface in the class name...
I, personally, prefer putting "Interface" or some other keyword into the name of the interface so it's clear in code (ie. if ($foo instance of DB_Interface)).
I've been going with Foo_Interface, but usually it's even further down the tree: Foo/Adapter/Interface.php -> class Foo_Adapter_Interface
Foo/Adapter/Bar.php       -> class Foo_Adapter_Bar implements it
I do the same with Abstract. -- Matthew Weier O'Phinney mweierophinney@gmail.com http://weierophinney.net/matthew/ PHLY Channel: http://weierophinney.net/phly/

« previous php.pear.dev (#42723) next »