solid design principles code example

Example 1: solid

S.O.L.I.D stands for:
S - Single-responsiblity principle
O - Open-closed principle
L - Liskov substitution principle
I - Interface segregation principle
D - Dependency Inversion Principle

Example 2: solid principles c#

// Every world has its meaning
S: is single responsibility principle (SRP) 
   A class should take care of a Single Responsibility
   
O: stands for open closed principle (OCP) 
   Prefer extension over modification
   
L: Liskov substitution principle (LSP)
   The parent class should be able to refer child objects seamlessly during runtime polymorphism
     
I: interface segregation principle (ISP)
   A client should not be forced to use an interface, if it doesn’t need it 
   
D: Dependency injection principle (DIP)
   High level modules should not depend on low-level modules, but should depend on abstraction.

Tags:

Misc Example