Open/Closed Principle

OCP

Kind: principle

Layer: Structural Core

Aliases: OCP, Open-Closed Principle

Record: architecture:open-closed

Severity: recommended

Scope: class, module, component

Canonical: Ontology

A design rule that a module gains new behavior by adding code at an extension point, leaving its existing code unchanged.

Listed in Architecture principles, after Dependency Inversion Principle (DIP) and before Liskov Substitution Principle (LSP).

Requires

Reinforces

Enables

Conflicts with

In tension with

Tensions

Contracts

Violated by

Refactored by

Severity

Category

Enforced by

Reinforced by

Linked from

in this codebase