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

Ingo Renner typo3 at ingo-renner.com
Tue Dec 12 03:18:15 CET 2006


Robert Lemke wrote:

Hi Robert,

>>> - Classes (e.g. HelloWorld) -> HelloWorld.php
>>> - Interfaces (e.g. IHelloWorld) -> IHelloWorld.php
>>> - Exceptions (e.g. HelloWorldException) -> HelloWorldException.php
> 
> Following the suggestion of my other post (using entity types) this 
> would transform to:
> 
> T3P_MyPackage_Greeter
> T3P_MyPackage_HelloWorldGreeter
> T3P_MyPackage_HelloWorldException


IMO the most obvious naming would be the following:

T3P_MyPackage_IGreeter (interface)
T3P_MyPackage_Greeter (general implementation of a greeter class)
T3P_MyPackage_HelloWorldGreeter  (extended Greeter class)
T3P_MyPackage_GreeterException (a greeter class extending the general 
exception class)

that would separate the interfaces from the classes as in fact 
interfaces aren't classes because they do not have attributes, method 
implementations and can't be instantiated.
On the other hand you can still have a very general (optionally 
abstract) class.

I hope you see the point...


Ingo


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