[TYPO3-core] RFC: Feature Request #9078: Integrate hook in page module to render preview of records with own CType

Dmitry Dulepov [typo3] dmitry at typo3.org
Wed Aug 13 17:28:09 CEST 2008


Hi!

Oliver Hader wrote:
>> t3lib_div::callUserFunction is the best, easy to use, and it would 
>> make sense if all hooks are called the same way.
>>
>> Now we have 3 different kinds of hooks, which makes it not easy for a 
>> developer.
> 
> This means that we would declare the interfaces for hooks that have been 
> introduced in TYPO3 4.2 to be obsolete. Well, I don't like the idea of 
> completely throw away such things.

No, it does not mean this. You are not using interfaces in this case, so they are not applicable. You are using traditional hooks. So it would be better to use more flexible hook approach.

> The disadvantage is that new functionalities in an interface class, such 
> as new/forgotten function arguments or new functions will cause old hook 
> implementations to fail.

Did not get this point, sorry :(

> The advantage of the interface/getUserObj method is, that there is a 
> well defined description how the hook must be implemented. This also 
> means that hooks and their parameters could be documented automatically 
> and that an error handling could do something if a hook does not 
> implement the interface.

But it seriously limits developer in adding parameters to existing hook (in $param array) + it creates naming problems for functions in user's class.

-- 
Dmitry Dulepov
TYPO3 Core team
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog: http://typo3bloke.net/post-details/typo3_code_formatting_in_eclipse/


More information about the TYPO3-team-core mailing list