Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

SOLID design principles

S – Single Responsibility Principle


S – Single Responsibility Principle
S – Single Responsibility Principle
S – Single Responsibility Principle
O – Open Closed Principle
O – Open Closed Principle
O – Open Closed Principle
O – Open Closed Principle
O – Open Closed Principle

Disadvantage of not following Open Closed Principle

1. Whenever new logic is added it is always necessary to test for full functionality.
2. It also breaks the Single Responsibility Principle since a class or function might end up doing multiple tasks.
3.Class or function maintenance becomes difficult since a class or function can become thousands of
lines of code that are difficult to understand.
O – Open Closed Principle
O – Open Closed Principle
O – Open Closed Principle
O – Open Closed Principle

USE of specification pattern


USE of specification pattern
O – Open Closed Principle
O – Open Closed Principle

USE of specification pattern


O – Open Closed Principle
USE of specification pattern
O – Open Closed Principle
USE of specification pattern
O – Open Closed Principle
What if you want to combine the specification?
USE a combinator
O – Open Closed Principle
Add in Main to filter by blue and large
O – Open Closed Principle

The Open-Closed Principle encourages you to design code that can be


extended for new features without changing the existing, working
code. This principle is vital for maintaining, scaling, and collaborating
on software projects

You might also like