[TYPO3-ect] Improvement of the template engine
Elmar Hinz
elmar.DOT.hinz at team.MINUS.red.DOT.net
Wed Mar 15 07:50:02 CET 2006
Franz Koch schrieb:
> Hi Jean-Baptiste
>
>> It sounds very interesting. How much time do you need to extract a
>> general API ?
>
>
> Could take some time as I'm currently very busy. Can anybody give me a
> brief definition what a good API should at least be containig of,
> capable of or shouldn't use at all?
>
I think will write a kind of guildeline on this as soon as I find the
time. In short this are my proposals:
1.) Follow CGL:
http://typo3.org/documentation/document-library/core-documentation/doc_core_cgl/current/
2.) Get ideas from PEAR:
http://pear.php.net/manual/en/standards.php
3.) useCamelCaseNames. It looks better and is shorter than
use_camel_case_names. Underscrores are still free for special
features: class.camelCaseNameWithSpecialSuffix_testcase.php
4.) Use speaking names with common grammer:
getStyledContent reads better than styledContentGet.
5.) Prefer full words to abbreviations. Full words are best code
comments you can have. Others would allways have difficulties to use
your personal style of abbreviations. Shortcuts are confusing: pw?
passwd? pass? pwd? Fullwords are clear: password.
6.) Architecture: Use small classes and small functions. Small pieces
are easier to repair, to extend, to replace then large pieces.
7.) If possible use unit tests: They teach you to find a good
architecture. Only a good architecture can easily be unit tested.
8.) If all is done, not at the beginning, it can by usefull to put one
class before the set of classes that combines all public interfaces of
your tool into one commen doorway. It should contain no functionality
at all but only dispatch to the real classes.
Regards
Elmar
More information about the TYPO3-team-extension-coordination
mailing list