How to differentiate what could be done explicitly in a domain class and what in an Event Listener

by JorgeeFG   Last Updated April 29, 2018 06:05 AM

For example, my library returns an Edit Profile form. But the form must be pre fille with the existing information.

Should I raise an Event before returning the form so that a listener could pre fill it?

I thought then that event listeners might not be executed right away (in a blocking way), that this would depend on the implementation of the event bus handler. So this particular problem seems to have an answer.

But what are the guidelines to see if it would be best to let an event modify the system or to explicitly declare the intention in the domain model or class?

Related Questions