Skip to content

Commit b7904b7

Browse files
authored
Update README.md
1 parent 86d8299 commit b7904b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

2 - Open-Closed Principle/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Open/Closed Principle (OCP)
22

3-
The Open/Closed Principle (OCP) is a design principle from the SOLID principles that suggests that software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. In other words, you should be able to extend the behavior of a system without modifying its existing code.
3+
The Open/Closed Principle (OCP) establishes that software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. In other words, you should be able to extend the behavior of a system without modifying its existing code.
44

5-
The OCP is important because it promotes code that is easier to maintain and extend. By designing your code to be open for extension, you can add new functionality to the system without breaking existing code or modifying existing functionality. This makes the codebase more robust, scalable, and easier to work with.
5+
By designing your code to be open for extension, you can add new functionality to the system without breaking existing code or modifying existing functionality.
66

77
To follow the OCP, it's important to design your system with a clear separation of concerns, using interfaces or abstract classes to define behavior that can be extended by implementing new concrete classes. This allows you to add new functionality by creating new concrete classes that implement the existing interface or abstract class, without modifying the existing code.
88

0 commit comments

Comments
 (0)