[TYPO3-ect] Hooks vs Patterns

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Thu Apr 13 16:05:40 CEST 2006


Ernesto Baschny [cron IT] schrieb:

Hi Ernesto,


> Hi,
> 
> regarding TYPO3 hooks, what is your opinion on that?
> 
> I would like to discuss the merits and drawbacks of having that
> "hook-based" approach, and would like to invite you to try to rethink
> some of the hooks in a more OO way, using well known design patterns.
> 
> Right now a patch is being discussed by the core team to add a hook for
> extensions to create new TS-cObject types. This would be a simple
> replacement for the "bloated" obts way of doing that. While I find that
> really useful, I think a better design pattern to acchieve that would be:
> 

parts of this ideas are already implemented in tx_lib, not for TS surely.

> 1) A registry to register new object types

We can register childcontrollers.

> 2) A defined interface which a new object type has to implement (fairly
> simple), maybe a class that has to be extended.

All date carrying objects in the pluging currently inherit tx_data.


> 3) A factory to get a certain typoscript object by its name, which can
> then be used by cObject.
> 

tx_div::makeInstance();

Please test current articles, lib, div.


Regards

Elmar





More information about the TYPO3-team-extension-coordination mailing list