eZ Community » Forums » eZ Publish 5 Platform » Lost in concepts: Signal/Slot or...
expandshrink

Lost in concepts: Signal/Slot or Event/Listener ?

Lost in concepts: Signal/Slot or Event/Listener ?

Friday 29 August 2014 4:23:57 pm - 4 replies

Could you explain me please why Signal/Slot concept is introduced in eZ Publish 5 instead of standard symfony Event/Listener concept? Is it something in the current approach that is (was) not possible to do with symfony EventDispatcher?

Modified on Monday 01 September 2014 2:48:05 pm by Andrey Astakhov

Friday 29 August 2014 6:04:59 pm

Afaik the reason is that most of the low-level plumbing in eZ5 was developed before it was decided to use Symfony as framework.

This is why some features are duplicate, and a few other oddities as well (f.e. not everything in the repo is decoupled into independent services, the security token for forms was also done independently, and of course the login handler).

Going forward I think you will see more and more integration, which is good (unless you are a laravel developer wanting to use eZ blunk.gif Emoticon )

Friday 29 August 2014 11:12:04 pm

Afaik the reason is that most of the low-level plumbing in eZ5 was developed before it was decided to use Symfony as framework.

This is not the only reason. SignalSlot is meant to be asynchronous, and thus signals only carries scalar values, while Symfony event dispatcher can carry anything, and mostly objects. The idea behind this is to use asynchronous engines to take care of some heavy work.

Sunday 31 August 2014 5:12:23 pm

> the security token for forms was also done independently

rather because we had different system in legacy which we needed to keep for bc, not a form token system in Platform/new stack, we have used symfony there since day one.

> of course the login handler

more because we actively used our legacy system for several features in 5.0 and after that has gradually transitioned to corresponding symfony features, login handing was transitioned in 5.3.

 

And as for signal slots vs events, see reply form Jérôme, also these are also sent to symfony event system thanks to SymfonyEventConverterSlot afaik. So you should be able to listen to them in event system instead if you prefer.

Modified on Sunday 31 August 2014 5:19:30 pm by André R

Monday 01 September 2014 8:05:24 am

Quote from André R :

...these are also sent to symfony event system thanks to SymfonyEventConverterSlot afaik. So you should be able to listen to them in event system instead if you prefer.

Good news.

Well, Signal/Slot concept will stay as a part of eZ Publish architecture and will never be replaced with Symfomy EventListener, is it so?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from