Reinventing core's handler system in Group for more flexibility

Speaker(s)
kristiaanvandeneynde
Session track
Code & Development
Experience level
Expert
Duration
50 min

The entity handler system in core is great: It allows us to have service-like classes that deal with specific tasks for specific entity types without turning the actual entity type's class into a monolithic pile of bloat. But it has one major downside: the handlers are defined with strings, more specifically a reference to a class.

This means that, while people can change what class the handler declaration points to, only one handler will ever be used and it's the last module to define it that wins. So any chance of multiple modules changing the behavior of said handler is immediately killed off due to the way of declaring these handlers.

Group also has a handler system that was initially copied from core and I have also run into the same limitations when it comes to third parties trying to alter my handlers. For that reason, I decided to completely overhaul how handlers work and managed to come up with a solution I think would even do wonders in core itself. I would like to present this solution to you as it will ship (or has shipped by then) with Group 2.0.0.

Session video: