Open Closed Principle
●

OOP and OOD

●

Open Closed Principle

●

The Idea

●

Problems Solved

●

Example and Discussion
Object Oriented Programming
Object-oriented programming (OOP) is a
programming paradigm that represents
concepts as "objects" that have data fields
(attributes that describe the object) and
associated procedures known as methods.
Object Oriented Design
Object-oriented design is the process of
planning a system of interacting objects for the
purpose of solving a software problem.
Open Closed Principle
"software entities (classes, modules,
functions, etc.) should be open for extension,
but closed for modification"
The idea was that once completed, the
implementation of a class could only be
modified to correct errors; new or changed
features would require that a different class be
created.
Class keeps growing when requirements are
increased, which is to add new functionalities
to it.
Break single responsibility at some point
Break existing test and public API
Break application
Example
Discussion
When to know if a class is completed?
When to know that we are applying OCP?
What do I do if business logic has changed?

Open Close Principle