Chapter 11. SOLID Principles

Designing software is a tricky task. Often an application grows following the user's needs, and if it is poorly designed, sooner or later we will face troubles. The SOLID principles can help us to design better applications. They allow us to detect points of weakness and to write robust, flexible, and maintainable code. Even though SOLID principles were born for classical OOP languages, they can be applied to JavaScript language as well.

In this chapter, we will explore the SOLID principles by discussing the following topics:

  • Single Responsibility Principle
  • Open/Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle

Principle of OOP design

When we discussed the Object-Oriented ...

Get Mastering JavaScript Object-Oriented Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.