5 ms·
One option would be to use a service object (e.g. UserCreator) which would encapsulate the action (saving a user) along with the action to be taken (delivering
by spohlenz 14y ago
One option would be to use a service object (e.g. UserCreator) which would encapsulate the action (saving a user) along with the action to be taken (delivering a signup email).
With external observers, it's not always obvious whether they are enabled or not. Service objects make this more explicit and are easier to test as well.