Design and Development Principles

Created : July 20, 2020


5 important design principles when doing OOP(Object Oriented Programming).

  • S : Single responsibility principle

    • A class should have only one reason to change.
    • Gather together things that change for the same reasons.
  • O : Open/closed principle

    • Software entities should be open for extension but closed for modification.
  • L : Liskov substitution principle

    • The sub-types must be replaceable for super-types without breaking the program execution.
  • I : Interface segregation principle

    • Clients should not be forced to depend upon the interfaces that they don't use.
  • D : Dependency inversion principle

    • High-level modules should not depend on low-level modules.

KISS = Keep It Simple, Stupid

Most systems work best if they are kept simple rather than made complicated.

YAGNI = You Aren't Gonna Need It

Don't add functionality until you need it.

DRY = Don't Repeat Yourself

Reduce repetition of code blocks