Open Close Principle

30 %
70 %
Information about Open Close Principle

Published on January 22, 2014

Author: thaichor



SOLID design principle, Open Close Principle

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



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?

Add a comment

Related presentations

Related pages

Open/closed principle - Wikipedia, the free encyclopedia

Meyer's open/closed principle. Bertrand Meyer is generally credited for having originated the term open/closed principle, which appeared in his 1988 book ...
Read more

Open Close Principle | Object Oriented Design

Open Close Principle Motivation. A clever application design and the code writing part should take care of the frequent changes that are done during the ...
Read more

A simple example of the Open/Closed Principle

The Open/Closed principle says that we should strive to write code that doesn’t have to be changed every time the requirements change. Here's a simple ...
Read more

The Open Closed Principle | 8th Light

In 1988 Bertrand Meyer defined one of the most important principles of software engineering. The Open Closed Principle (OCP). In his book Object Oriented ...
Read more

SOLID: Part 2 – The Open/Closed Principle

Single Responsibility (SRP), Open/Closed (OCP), Liskov's Substitution, Interface Segregation, and Dependency Inversion. Five agile principles that should ...
Read more

SOLID Principles: The Open Closed Principle -> What, Why ...

In 1988 the open closed principle (OCP) is already mentioned by Bertrand Meyer : Software entities (classes, modules, functions, etc.) should be ...
Read more

Open Closed Principle - CodeProject

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
Read more

Open Closed Principle -

The book examples given of this principle seem to be rigged to only show changes that go "with the grain" of the example's partitioning. For example, they ...
Read more

O is for Open/Closed Principle - Realm

SOLID Principles for Android #2: Open/Closed Principle, by Donn Felker
Read more

Open-Closed-Prinzip – Wikipedia

Das Open-Closed-Prinzip (Prinzip der Offen- und Verschlossenheit, kurz OCP) ist ein Prinzip beim objektorientierten Entwurf von Software. Es beschäftigt ...
Read more