neos / Neos.EventSourcing

A library for Event Sourcing and CQRS for Flow projects.
MIT License
45 stars 30 forks source link

More extensible event listener method resolution #282

Open bwaidelich opened 3 years ago

bwaidelich commented 3 years ago

With #256 we introduced some configurable "event listener mapping" that allows to hook into the process of DomainEventInterface => EventListenerInterface resolution.

The expected listener method name is still hard coded to when<EventShortClass> in the EventListenerInvoker though.

The listener method invocation should be extracted to a configurable strategy so that this behavior is extensible. This is especially useful for standalone usage (#180) and might pave the way for "catch all event listeners" (#259).

bwaidelich commented 3 years ago

@skurfuerst had the idea to implement this in a composable way, i.e.

ApplyEvent = ApplyEventBeforeAfter(ApplyMyOwnEvent())
skurfuerst commented 2 years ago

@bwaidelich funny that we had similar ideas already :D :D