In the article How to Make MVC Components Skinny in Rails we defined a concrete purpose of each component, what's happening with code when it starts containing redundant logic, and finally figured out the solution that helps make code clear and concise. This solution is refactoring.
Having the solution defined we specified the tools (design patterns) to aid us in the refactoring process, including:
- Service Objects (and Interactor Objects)
- Value Objects
- Form Objects
- Query Objects
- View Object (Serializer/Presenter)
- Policy Objects
- Decorators
So, this repo contains specific code examples that represents these seven design patterns for MVC refactoring. To see each design pattern in work you can read the article "7 Design Patterns to Refactor MVC Components in Rails" written for SitePoint.