Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: