[TYPO3-mvc] Alternative to hooks

Pascal Jungblut mail at pascal-jungblut.com
Sun Jan 16 15:16:36 CET 2011


Hey Sebastian,

thanks for your answer. 

On 05.01.2011, at 17:20, Sebastian Kurfürst wrote:
> - Aspect-Oriented Programming: To implement *unplanned* extensibility;
> not possible in Extbase, and most likely will never be possible, but
> possible in FLOW3
> 
> - Signals / Slots [1]: Good for *planned* extensibility, as it provides
> very loose coupling. Also implemented in FLOW3, and not yet in Extbase.
> However, it might be possible to implement this feature in Extbase as
> well :-)


I finally had time to look into that. The Signals/Slots implementation of FLOW3 uses AOP to intercept when the signal needs to get dispatched. However, the rest seems pretty straight forward. The drawback in v4 would be, that you'd have to call the dispatch() function yourself, but for what I've seen thats normal. QT and C++'s Boost both expect you to call a signal-function "manually" (in contrast to something like AOP).

Unfortunately the implementation of F3\FLOW3\SignalSlot\Dispatcher::dispatch() doesn't allow any kind of "feedback" to the signal. I think a high percentage of hooks is used to manipulate the output of something (not just to get a "ping" that an event happened). I hope I get this wrong, but without any kind of return-value Signals and Slots won't be an alternative to hooks for most use-cases. However, it would be simple to pass the $signalArguments as a reference so it can be changed later, but that would be a change in v5. What do you think?

Regards
Pascal


More information about the TYPO3-project-typo3v4mvc mailing list