


Open Closed Principle states that “Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.”įollowing this principle ensures that a class is well defined to do what it is supposed to do. Martin mentioned this as “the most important principle of object-oriented design”. Open Closed Principle was first conceptualized by Berterd Meyer in 1988. This would ensure that TelephoneDirectory class has only one reason to change that is any change in its primary responsibility We can pass the TelephoneDirectory object to the objects of those classes and write any additional features in those classes. We can handle the current situation by having separate classes that would handle database persistence and saving to file. The Single Responsibility Principle asks us not to add additional responsibilities to a class so that we don’t have to modify a class unless there is a change to its primary responsibility. Thus, TelephoneDirectory is prone to changes due to the reasons that are not its primary responsibility. In the future, if there are any requirements related to persisting the data then those can cause changes to the TelephoneDirectory class. This class now has additional features that can cause it to change. By adding the functionalities of persisting to the database and saving to file, we gave additional responsibilities to TelephoneDirectory class which are not its primary responsibility. Now, this is where we broke the Single Responsibility Design Principle.
#Interface segregation principle python software
These best practices, when considered in designing an object-oriented software application would tend to reduce code complexity, reduce the risk of code breaks, improve the communication between different entities and make code more flexible, readable, and manageable. Uncle Bob has introduced various Design Principles and among them, the most popular are the five principles acronymic as SOLID Design Principles that are primarily focused on Object-Oriented Software Designing. One of the most important and most popular are the Design Principles introduced by Robert C Martin (Uncle Bob). One of the most popular among these are the design principles popular by the acronym – SOLID.

Many researchers and experts have defined various best practices towards efficient designing of software applications. Once the algorithm is in place, the next most important thing in Software Engineering would be to ensure that the software or the application is designed with best designing and architecting practices. An efficient algorithm sets the base of an efficient software application.
