0% found this document useful (0 votes)
32 views2 pages

What Is Open - Closed Principle of SOLID

The document discusses the Open/Closed Principle (OCP) which states that software entities like classes, modules, functions etc. should be open for extension but closed for modification. Without OCP, adding new requirements would require modifying existing code. With OCP and the Single Responsibility Principle (SRP), new requirements can be added by extending the code through inheritance or composition without changing existing code.

Uploaded by

Vitor Bontempo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

What Is Open - Closed Principle of SOLID

The document discusses the Open/Closed Principle (OCP) which states that software entities like classes, modules, functions etc. should be open for extension but closed for modification. Without OCP, adding new requirements would require modifying existing code. With OCP and the Single Responsibility Principle (SRP), new requirements can be added by extending the code through inheritance or composition without changing existing code.

Uploaded by

Vitor Bontempo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Open/Closed Principle (OCP)

[Without OCP]

Original

New Requirement

@MuhamamdWaseem
Open/Closed Principle (OCP)
[With SRP & OCP]

Single Responsibility

Open/Close
@MuhamamdWaseem

You might also like