[TYPO3-50-general] File name conventions for classes and interfaces
Karsten Dambekalns
karsten at typo3.org
Fri Dec 1 14:52:17 CET 2006
Hi Robert.
Robert Lemke wrote:
> a) Why is an exception so special that it deserves its own name?
> In my eyes, it's just a class so I wouldn't make an exception
> here.
Hm. I am unsure here. Although you technically instanciate an exception,
you usually don't "use" it, but just "throw" it. If we remove the
prefix/suffix we should make sure the class name contains Exception
(which should be a general rule in the CGL anyway and would be only
natural to most people, I guess).
> I therefore propose switching to the folloing pattern:
>
> T3C_PackageName_ComponentClassName.class.php
> T3C_PackageName_ComponentInterfaceName.interface.php
If there only were real refactoring tools for PHP... :) I agree, though.
I fought for the existing way first, but now I changed my mind.
> And furthermore, extend the naming convention for classes: If a class
> implements one interface, it should be named after it:
>
> T3C_Hola_HelloWorld.interface.php
> T3C_Hola_HelloWorldImplementation.interface.php
What about classes implementing two, three, ... interfaces?
Regards,
Karsten
--
Karsten Dambekalns
Gimme Five!
http://typo3.org/gimmefive
More information about the TYPO3-project-5_0-general
mailing list