Posts

Showing posts from May, 2020

SOLID Principles

Image
In Object-Oriented Programming (OOP) Concept, SOLID principles are the acronym for five Object-Oriented Design (OOD) principles. These SOLID principles are used to improve the understand-ability, flexibility and maintainability of the code.   S.O.L.I.D. Stands For? 1.      S - Single-responsibility principle 2.      O - Open-closed principle 3.      L - Liskov substitution principle 4.      I - Interface segregation principle 5.      D - Dependency Inversion Principle   Let’s see what is the exact meaning of each principle using an example. Ex: There is an online store. A registered customer can place an order and purchase them using the card or make payment when delivering the order. Let’s move to the principles again.   1.      Single-Responsibility Principle The common definition of this principle is “A class should have one and only one reason to change, meaning that a class should have only one job.” When we consider the above online store, there is a class