DEV Community


Discussion on: Ruby on Rails pattern: Service Objects

fduteysimfinity profile image
  • services should be stateless
  • services are part of application, not web, they shouldn't take URL params such as ids but rather objects. They also should be in lib directory, not app (since web is called app, and app is called lib in rails, so confusing)
  • services should not inherit but rather use composition (and therefore, use their instance variables to represent their link to other services, using Dependencies Injection to manage them)