When developing a library of classes, is there a best practice for naming the files?
I was thinking somehow it should reflect the hierarchy of the classes. I was thinking of implementing something like:
Foundation.parent.class.php // Concrete parent class (Class with common implementations) File.abstract.class.php // Abstract class (extends Foundation) FileLog.class.php // Child class (extends File)
So within this convention:
- Concrete classes that are solely used as a base for another class have the suffix parent
- Abstract classes have the suffix abstract
- Child classes start with the class name it is extending
Is this a good implementation or is there a better way?
Naming conventions
Names of files should not have any suffixes of prefixes – only name of class, to make it possible find them by
autoloader.Never. It’s a common practice to add (into name of class) words like Interface, or Abstract, but not names of parents, definitely.