I have a blog where users can post comments. When creating a comment, various things happen:creating the comment object, associations, persistingsending notification emails to post's author given his preferencessending notification to moderators given their preferencesupdating a fulltext database for search...I could put all this in the controller, but what if I want to reuse this code ? e.g. I would like to provide an API for posting comments.I could also put this in the model, but I wonder if I won't lose flexibility by doing so. And would it be acceptable to do all of this from the model layer ?What would you do ?
Models, controllers, and code reuse
design;object oriented;mvc