Re: Interface naming standards?

From: Date: Thu, 01 Jun 2006 18:17:10 +0000
Subject: Re: Interface naming standards?
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42728@lists.php.net to get a copy of this message
On 6/1/06, Joe Stump <jstump@enotes.com> wrote:
Matthew, Yeah, as soon as I sent out the "Interface_Foo" I realized it should have been "Foo_Interface" and concur with your thoughts. Anybody else? With more PHP5 packages coming along I think this should probably be in the CS via an RFC of some sorts.
I agree with the Foo_(BAR_)Interface naming.
--Joe On Jun 1, 2006, at 9:46 AM, Matthew Weier O'Phinney wrote: 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/ -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Justin Patrin

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