[TYPO3-50-general] Discussion to CodingStandards

Malte Jansen mail at maltejansen.de
Mon Jan 14 12:50:58 CET 2008


Hi Robert,

I have checked the CGL...

And found some unclear things:

---- Guide To T3 5.0 -> CGL
Files and file names
...
  * Names of configuration files must names start with configuration_
...

What configuration is ment here. Some internal package configuration or 
some configuration like:
- PackageConfiguration.php
- Configurations.conf

So must/can we check this?

---- CodingStandards

(RL) currently we don't need to worry about that. As soon as we have the 
persistence manager in place, you don't care about databases anyway. But 
even if you do, we shouldn't be that restrictive.


What does the persistence manager exactly do?
Just checking DB-issues? Or does it replace queries?

Perhaps this check should be done for mysql, because the problems is in 
T3 4.x most extensions work only with MySQL. With this check you could 
make sure, T3 5.0 is more flexible and open.

----

Perhaps the TYPO3CGL could be used as guide, linking to some suggestions 
for beautyful code and better programming. For most devs the OOP, 
namespace etc are new, so if they could run the TYPO3CGL over there code 
and they can learn from it. So the barrier from 4.x to 5.x will decrease.

Robert Lemke schrieb:
> Hi Malte,
> 
> Am 21.12.2007 um 12:01 schrieb Malte Jansen:
> 
>> what about
>>
>> Abstract-Classes?
>>
>> I have not found any thing about it. But sometimes there are pretty
>> useful...
>>
>> Should there be some checks?
>> Should "Abstract" be mentioned in the Name?
>>
>> MyPackage/Classes/T3_MyPackage_MyBaseAbstract.php
> 
> yes. But the class name should start with "Abstract" because most of the 
> time the
> abstract class would end up alone in its own namespace:
> 
>   T3_UNKNOWN3_MVC_Controller_AbstractController

I did not mean it this way...
It's true. It does not make sense to leave it alone in a namespace.

What about allowing these two ways for a abstract-class. So the dev can 
decide, which is the best way in the context using the abstrac.t
There is no difference for the CM and the namespace

T3_UNKNOWN3_MVC_Controller_AbstractController
T3_UNKNOWN3_MVC_Controller_Abstract

So you have rule: '|_Abstract[a-zA-Z0-9]*$|'

Same for interfaces...

T3_MyPackage_MyFilters_FilterInterface
T3_MyPackage_MyFilters_Interface

Perhaps additional there could be a rule like:
If you have just the Interface-name, all classes in the same 
folder/namespace must implement this interface.

e.g.
T3_MyPackage_MyFilters_Interface
T3_MyPackage_MyFilters_Alphanumeric
T3_MyPackage_MyFilters_Email
T3_MyPackage_MyFilters_...

It would make sense to put the Interface somewhere else.
(Perhaps) it would be clear, that you have to use the interface in these 
  folder/namespace.

> 
> and not
> 
>   T3_UNKNOWN3_MVC_Controller_Abstract (like it's currently)
>   T3_UNKNWON3_MVC_Controller_ControllerAbstract
>   T3_UNKNWON3_MVC_ControllerAbstract
> 
> I added that to the CGL documentation. Please let me known if it's 
> unclear or
> doesn't make sense for you.
> 

Cheers,

Malte


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