[TYPO3-50-general] Common namings for variables with path-content

Robert Lemke robert at typo3.org
Wed Jan 14 15:18:47 CET 2009


Hi Malte,

Am 12.01.2009 um 14:51 schrieb Malte Jansen:
>>
> I thought $objectFactory is called because of the Component "Object"  
> and
>  its className "Factory"
> Same for the PackageManager $packageManager etc.

nope. It's because the object represents a package manager etc.
However it's true that names of subpackages are often used.

A variable containing an instance of F3\TYPO3\Domain\Model\Content\Page
would just be called "$page" and not "$domainModelContentPage".

>>>> Strictly speaking, __CLASS__ should be $fullQualifiedClassName -  
>>>> but
>>>> maybe we find a better name?
>>>
>>> There is also a name missing for a part of the namespace. First I  
>>> had in
>>> mind "component", but it's reserved for a subpackage.
>>>
>>> e.g. $class = F3\MyPackage\SubPackage\MyClass
>>> foreach (explode('\\', $class) AS ??????) {}
>>> Any ideas?
>>>
>>>
>>> Annotation:
>>> Sticing closer to PHP I had in mind
>>> with "directory" as "absolutePath", because of the function  
>>> is_dir() and
>>> the  DirectoryIterator...
>>

Another example is an instance of "ReflectionClass". That's actually a  
weak PHP name because it actually is not litterraly a "reflection  
class" or "reflection method" but a "class reflection" or "reflection  
of a class".

Therefore the variable could be named $classReflection or just $class  
if we assume that the reflection of a class is as good as the class  
itself.

Cheers,
robert


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