[TYPO3-50-general] File name conventions for classes and interfaces

Ingo Renner typo3 at ingo-renner.com
Fri Dec 1 00:13:00 CET 2006

Robert Lemke wrote:

Hi Robert,

>   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.


>   b) After staring at it for a while I like it better if we use
>      "class" and "interface" as a suffix rather than a prefix
>      because the package- / component name is more important and
>      sorting is nicer / more logic.
> I therefore propose switching to the folloing pattern:
>    T3C_PackageName_ComponentClassName.class.php
>    T3C_PackageName_ComponentInterfaceName.interface.php

No, it makes it harder to spot the interfaces among the classes. Other 
than that it is not really common...

> 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

No, I think the same argument you came up with for exceptions should 
count here - it's just a class. Second, what if you have a class that 
implements more than one interface or you change which interfaces a 
class implements?!


More information about the TYPO3-project-5_0-general mailing list