3 ms·
Well, you are right, the model should not send the mail to new users. There should a way for the mail service to poll the model for emails to be sent. So the bu
by gbog 13y ago
Well, you are right, the model should not send the mail to new users. There should a way for the mail service to poll the model for emails to be sent. So the business rule here is still coded in the model. Say you want to also send the same email to old inactive users, you should just need to change the model, add a new business rule.
If you add such rules in the controller, you have to split your rules in two places, which is bad.
Ideally, I always thought that business rules should be a kind of "config", or more accurately a set of files written in a mini-domain language, that would be readable by PMs. Then it would be the job of the model to interface this set of rules with the controller.
So no, business rules and logic and whatever do not belong to the controller.