[TYPO3-core] Signals vs. Hooks

Markus Klein klein.t3 at reelworx.at
Mon Aug 25 15:34:16 CEST 2014


Hi Bernhard,

we recently discussed and clarified that, but I guess that was on slack.

The signal/slot pattern is meant for one-way (asynchronous) communication, hence the signaled component has no possibility to modify or influence the behavior of the signaling component. 
This pattern is, unfortunately, violated by the current Core implementation - it is easily possible to do so, as everything in PHP runs synchronously - since our implementation does allow manipulations. Therefore it is nothing else but another variation of our traditional hooks.

My suggestion - albeit being a breaking one - is therefore: Dump the concept of signals as PHP is inherently non-parallel.
Rename the current signal/slot implementation to "<some new hooking mechanism>", migrate all existing hooks to this mechanism.
The new hook mechanism shall be based on Interfaces and shall allow data manipulation (preferably via data objects).

Kind regards
Markus

------------------------------------------------------------
Markus Klein
TYPO3 CMS Active Contributors Team Member

> -----Original Message-----
> From: typo3-team-core-bounces at lists.typo3.org [mailto:typo3-team-core-
> bounces at lists.typo3.org] On Behalf Of Bernhard Kraft
> Sent: Monday, August 25, 2014 2:14 PM
> To: typo3-team-core at lists.typo3.org
> Subject: Re: [TYPO3-core] Signals vs. Hooks
> 
> Hi,
> 
> On 2014-08-24 21:10, Philipp Gampe wrote:
> 
>  > However it does not solve to
> > problem of allowing multiple observers for the same step.
> 
> Currently I didn't want to focus on the single/multiple aspect but ratheron
> the difference between observer and template pattern.
> 
> How would you (or anyone else) describe the major differences between
> hooks and the signal/slots? Would you call both an observer?
> 
> In fact the data return mechanism of signal/slots isn't very prominent and
> there should be a better solution.
> 
> 
> 
> If I find some time later on I will try to make a working-code proposal.
> Currently my time is rather sparse ...
> 
> 
> cu,
> Bernhard
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
> 
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core



More information about the TYPO3-team-core mailing list