The Open-Closed Principle (OCP) states that software entities (classes, modules, functions) should be open for extension but closed for modification. New functionality should be added by extending existing code, not modifying it.

In NestJS, the module system’s exports mechanism follows OCP — modules expose their providers for consumption without requiring internal modification. The DynamicModule pattern further enables extension through configuration without changing module internals.