Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SOLID Principles of Object Oriented Programming

Tarun Telang
September 22, 2022

SOLID Principles of Object Oriented Programming

SOLID principles make our code more understandable, maintainable, and extendable. They also help us avoid code smells.

Tarun Telang

September 22, 2022
Tweet

Other Decks in Programming

Transcript

  1. Low-Level Design (LLD) SOLID Principles A low-level design is a

    design that is detailed enough to be translated into a working implementation of software.
  2. Clean Code * Clean code is code that is easy

    to read and understand. * It is well-written, organized, and consistent. * Clean code is also easy to maintain and extend. * It is also easily testable.
  3. S: Single Responsibility O: Open / Closed L: Liskov Substitution

    I: Interface Segregation D: Dependency Inversion
  4. Single Responsibility Principle SRP is a design principle that states

    that a class should have one and only one responsibility. This responsibility can be divided into two parts: 1) the functionality of the class, and 2) the information that the class knows or owns.
  5. Open/Closed Principle Open/Closed principle states that a class should be

    open for extension but closed for modification.
  6. Interface segregation principle (ISP) (ISP) states that a client should

    NOT be forced to implement an interface it does not use. An interface should be divided into smaller interfaces, each defining a single responsibility.
  7. Dependency Inversion Principle (DIP) High-level modules should not depend on

    low-level modules. Both should depend on abstractions (e.g. interfaces).