Using services to manage code

Videos/Ruby on Rails Videos/Using services to manage code

Episode Notes

  • In all our applications we have a directory called app/services. In this directory we put all kinds of services. Now what’s a service.
  • A service is anything that a model should not be concerned about. Like How to send SMS, how to deliver email, making call to external service, parsing CSV file. It all depends on the application what should be in the model and what should be in the services.
  • The additional job of services is to keep model thin and manageable by extracting certain business rule into a service in itself.
  • 7 Patterns to refactor fat Active Record models