Open–closed principle

In object-oriented programming, the open–closed principle (OCP) states "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"; that is, such an entity can allow its behaviour to be extended without modifying its source code. The name open–closed principle has been used in two ways.

Source: Wikipedia — Open–closed principle (CC BY-SA 4.0)

Open–closed principle

In object-oriented programming, the open–closed principle (OCP) states "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"; that is, such an entity can allow its behaviour to be extended without modifying its source code. The name open–closed principle has been used in two ways.

Source: Wikipedia "Open–closed principle" · CC BY-SA 4.0

Share this article: X · Bluesky
Privacy Policy