From the course: Learning SOLID Programming Principles
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Introduction to the Open/Closed Design Principle - Python Tutorial
From the course: Learning SOLID Programming Principles
Introduction to the Open/Closed Design Principle
- [Instructor] The third solid design principle that I want to look at is the open/closed principle. The open/closed principle comes from Bertrand Meyer's book, "Object-Oriented Software Construction. And tells us that software entities should be open for extension but closed for modification. The open/closed principle is closely aligned with interface segregation in Liskov Substitution. We need to segregate interfaces based on the needs of the client classes. This often creates a class that's generally closed and doesn't need further modification. Liskov Substitution assures that the subclasses are proper extensions of the superclass, which means the superclass is open to extension. The open/closed principle summarizes the goals of the interface segregation principle and the Liskov Substitution principle. A design with good interface segregation and Liskov Substitution applied, tends to have classes which can be ended by…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.