Skip to main content

SOLID Design Principles in Rails Tutorial Series

In this series, we'll explain the SOLID principles using real-world examples as best we can so you can see how design patterns and principles can affect your code making it easier to read, understand, test, and maintain.

Single Responsibility Principle
#238 · Pro

A class should have only a single responsibility

Open Closed Principle
#240 · Pro

Software entities should be open for extension but closed for modification

Liskov Substitution Principle
#244 · Pro

Subclasses should add to a base classes behavior, not replace it

Interface Segregation Principle
#247 · Pro

The Interface Segregation Principle states that no client should be forced to depend on methods it does not use

Dependency Inversion Principle
#249 · Pro

Abstractions should not depend upon details. Details should depend upon abstractions