Skip to content

bilgep/SOLID-Principles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Applied Anti-SOLID and SOLID Principles

Code Samples and UML Class Diagrams


S - Single Responsibility Principle (SRP)

A class should have only a single responsibility.

srp


O - Open/Closed Principle (OCP)

A class should be open for extension but closed for modification.

ocp


L - Liskov’s Substitution Principle (LSP)

A type must be substitutable by its subtypes without altering the correctness of the application.

lsp


I - Interface Segregation Principle (ISP)

Clients of a class should not be forced to depend on those of its methods that they don’t use.

isp


D - Dependency Inversion Principle (DIP)

High-level classes should not dependent on low-level classes. Both of them should depend on abstractions.
Abstractions should not depend upon details. Details should depend upon abstractions.
dip


SOLID Short Control List

  • Do methods in the class have similar responsibilities? (SRP)
  • Are there any method in the class that functions different based on different variables? (OCP)
  • Are there any functionless methods/properties which comes from base class/interface in your derived classes? (LSP & ISP)
  • Are there initiations of non-abstract objects in a high-level class? (DIP)










Resources

Beginning SOLID Principles and Design Patterns for ASP.NET Developers - Bipin Joshi


By @BilgesPage

About

Code samples and UML class diagrams of Anti-SOLID and SOLID Design Patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages