mvc-components-refactoring-in-rails
mvc-components-refactoring-in-rails copied to clipboard
Code examples of MVC components refactoring in Rails from RubyGarage to SitePoint
How to Refactor MVC Components in Rails?
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.
RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!
