Applying SOLID principles to services

block of ice
  • Single Responsibility Principle (SRP)
  • Open/Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
  • Dependency Inversion Principle (DIP)

Single Responsibility Principle

  • Do I have multiple teams with different sets of deliverables all trying to make changes to this service’s code base?
  • Are my APIs falling into natural groups based on separate concepts? For example, are there separate REST resources for orders, products, and inventory?
  • Am I serving multiple types of users? For example, do I have APIs to support sales managers as well as customer service?
  • Do I find that there are clear divisions of the code where there is tight collaboration, with rather loose connections to other parts of the code?

Open/Closed Principle

GraphQL Resolver Architecture
Event-driven architecture

Liskov Substitution Principle

Interface Segregation Principle

Dependency Inversion Principle

SOLID Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store