Hacker News new | ask | show | jobs
Extending Ruby on Rails with Service Objects (blog.harigopal.in)
1 points by g3mo 3349 days ago
1 comments

The classic Model-View-Controller (MVC) method generally asks the programmer to put business logic in the model. This is sound advice for a small-to-medium size project, allowing a modicum of clarity and relative ease of testing, compared to business logic spread across controllers. However, as the number of problems your business tackles increases, bloating of the model is inevitable.

The service object pattern allieviates this with a back-to-the-roots approach, asking you to encapsulate different pieces of business logic in its own little container - each easy to understand, test, use, and re-use.