[TYPO3-english] COA inside another COA - is it a wise thing?

JoH asenau info at cybercraft.de
Tue May 11 15:49:25 CEST 2010


>> I would always prefer the solution with the COAs no matter if there
>> will be external data or not, because with the "simple" approach
>> you'll be stuck, when you want to add something before, after or -
>> even worse - in between the various parts.
>
> That's called "speculative generality" and it is usually a thing to
> avoid :) If you need to add more functionality later, you can always
> write a better TS for this new functionality. But making it too far
> in advance usually does not help because you cannot guess the future
> anyway :)

It's not speculative at all, as long as you *do know before* that you have
to add stuff to the TS code in other places than the template you are
currently working on.  So nothing to be avoided here :-)

i.e. you a re setting up lib.whatever to be used as the base for a lot of
different TS objects which all slightly differ from each other. Another
common example is the use of extension templates for certain pages, that
should behave differently. Using the COA approach you can easily activate,
deactivate or add stuff in between, without having to rewrite the whole
piece of code. And I already mentioned conditions in my last post, which
will be used for almost any site that is using login areas and/or a multi
lingual setup.

Of course, when you can be sure, that you don't need such a general approach
at all, the quick and dirty way will be faster, but in any other case IMHO
the COA way should be preferred.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com




More information about the TYPO3-english mailing list