Re: simple interface standard?

From: Date: Mon, 30 Aug 2004 13:28:55 +0000
Subject: Re: simple interface standard?
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33058@lists.php.net to get a copy of this message
Bertrand Mansion wrote:
Greg Beaver wrote:
Interface names would follow the convention that already exists: interface Mypackage_InterfaceSomething or, interface PEAR_InterfaceSomething <<END STANDARD>>
I would use Interface instead of simply "I" as some suggested because that's clearer to read and identify. But I would use it as a postfix like this: PEAR_Something_Interface
If you consider for one second interfaces as been like C/C++ .h header files, you most likely will have classes like this: PEAR_Something_that PEAR_Something_this PEAR_Something_other So PEAR_Something_Interface would make the most sense... In other cases the logical way to go would be PEAR_SomethingInterface for implementing classes that would go by PEAR_Something, MyPackage_SomethingElse The difference at the file level would be PEAR/Something/Interface.php vs. PEAR/SomethingInterface.php Sometimes the interface declaration is so small it should require an extra file, so could be included in the main package file. Still, the best PEAR uniform way to go seems to do PEAR_Something_Interface BTW: PEAR has strongly structured its packages while Java and other language don't have such "rigid" standard. So it's not really a good idea to go Java-style for naming the interfaces with "I/i"... -Philippe

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