[TYPO3-50-general] File name conventions for classes and interfaces
Robert Lemke
robert at typo3.org
Fri Dec 1 08:46:14 CET 2006
Good morning Ingo,
Ingo Renner schrieb:
>> 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.
That's true of course. On the other hand grouping of components won't be
that nice anymore. But if we make sure that classes / interfaces can be
logically structured by putting them into sub directories, that would be
fine.
> Other than that it is not really common...
Where? I had a hard time searching for other places defining such a
pattern. Most PHP frameworks tend to use no "class" or "interface" in
the file name. Anyway, your argument above counts.
>> 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?!
Yepp, that's what I also thought just last night ... Stupid idea.
Cheers
robert
More information about the TYPO3-project-5_0-general
mailing list