DESIGN PRINCIPLES

Cahyo Adi
Nov 4, 2020
https://learning.oreilly.com/library/view/clean-architecture-a/9780134494272/graphics/PA-UN03.jpg

“Good software systems begin with clean code. On the one hand, if the bricks aren’t well made, the architecture of the building doesn’t matter much. On the other hand, you can make a substantial mess with well-made bricks. This is where the SOLID principles come in.”

Robert C. Martin

When your code are hard to maintain, harder to read or small changes could result a bug. For those reason, we should follow SOLID Principles. SOLID Principles is a coding standard that we use while developing software properly to avoid bad design.

Here is the executive summary of SOLID:

  • Single responsibility principle: a class should have one, and only one, reason to change. Or the new version: a module should be responsible to one, and only one, actor.
  • Open-closed principle: a class should be open for extension but closed for modification.
  • Liskov’s substitution principle: objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface segregation principle: many client-specific interfaces are better than one general-purpose interface.
  • Dependency inversion principle: one should depend upon abstractions, not concretions.

On next series I will explain each principle one by one. Thanks for reading.

--

--