---
title: "Discussion on \"Open/Closed Principle (OCP)\" | Hashnode"
description: "Discussion on \"Open/Closed Principle (OCP)\". The definition of OCP that I had mentioned in this blog is this:\nSoftware entities (classes, functions, modules, or methods) should be open for extension but closed for modification. This allows you to add new functionality without changing existing ..."
url: "https://hashnode.com/posts/openclosed-principle-ocp/66ca1f7722c382f39c30ec4e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Open/Closed Principle (OCP)](https://designpatterns.hashnode.dev/openclosed-principle-ocp?utm_source=hashnode&utm_medium=feed)

The definition of OCP that I had mentioned in this blog is this: Software entities (classes, functions, modules, or methods) should be open for extension but closed for modification. This allows you to add new functionality without changing existing ...

Aug 24, 2024 · 13 min read · designpatterns.hashnode.dev  
Updated Apr 25, 2025  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#oop-design-principles](https://hashnode.com/tag/oop-design-principles)
-   [#design-patterns](https://hashnode.com/tag/design-patterns)
-   [#specification](https://hashnode.com/tag/specification)
-   [#open-closed-principle](https://hashnode.com/tag/open-closed-principle)
-   [#solid-principles](https://hashnode.com/tag/solid-principles)
-   [#interface](https://hashnode.com/tag/interface)
-   [#filter](https://hashnode.com/tag/filter)
-   [#generics](https://hashnode.com/tag/generics)

## Written by

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122)

@hegde10122 · Mumbai,India

  
[View profile](https://hashnode.com/@hegde10122)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
