[TYPO3-v4] "CGL" policy for new hooks?

Jigal van Hemert jigal at xs4all.nl
Sun Mar 13 19:19:52 CET 2011


Hi,

On 13-3-2011 17:46, Tolleiv.Nietsch wrote:
> I was just wondering if we should discuss what exactly the policy for
> new hooks is. In https://review.typo3.org/1003 I'm being pushed to use a
> hook which does an additional check against an interface.

As far as I have understood before becoming a core dev, the way with the 
interface is the "new" way to implement hooks in v4.

> Especially for https://review.typo3.org/1003 I don't consider the
> introduced hook to be relevant for many others and introducing it was
> just a matter of separating workspace stuff from the Core, that's why I
> didn't care about an interface.

Well, in the comments of the change for the hook subscriber you explain 
that you used a hook so other could make a custom preview message 
without XCLASS.

I think that using an interface makes it easier to check the proper 
implementation and reduces the overhead of callUserFunc which has to 
parse the user function 'definition' it gets passed for the path to the 
class file, the method name, etc.

You can use a single interface class per class to define all the 
necessary hooks.

I'd like to see interfaces for all future hooks, but that is my personal 
opinion.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert.


More information about the TYPO3-project-v4 mailing list