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

Malte Jansen mail at maltejansen.de
Wed Jan 14 17:25:33 CET 2009


Hi Robert,

Robert Lemke schrieb:
> 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.

But more clearly would be $classReflection than $class


Ok, what about calling the "namespace + className":
- globalClassName
- absoluteClassName

We could also use "localClassName" for the "className without 
Namespace". But than it would not fit to fileName or directoryName.

Cheers,

Malte


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