Open / Closed Principle

Posted inPrint Design Articles
Thumbnail for Open / Closed Principle
Closed

Arcana Department: The Open/Closed Principle states that the design and writing of the code should be done in a way that new functionality should be added with minimum changes in the existing code. The design should be done in a way to allow the adding of new functionality as new classes, keeping as much as possible existing code unchanged.

Wondering what all that means?

In object-oriented programming, the open/closed principle 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 modified without altering its source code. This is especially valuable in a production environment, where changes to source code may necessitate code reviews, unit tests, and other such procedures to qualify it for use in a product: code obeying the principle doesn’t change when it is extended, and therefore needs no such effort.

Closed
Open
Open
Open
Open

Resources Recommended by Imprint

  1. Get Inspired: Color Inspirations

  2. Creative Workshop, filled with 80 Brainstorming Challenges

  3. Get an inside look at logo design from Chermayeff & Geismar

  4. Join Imprint‘s contributor, Fahrenheit 212 for Keep It Simple Stupid: The Art of Designing Ideas

  5. Design TV: Improve your design skills with help from experts in the design industry.