Everything about Decorator pattern
Design pattern in object-oriented programming
In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object dynamically, without affecting the behavior of other instances of the same class. The decorator pattern is often useful for adhering to the Single Responsibility Principle, as it enables functionality to be distributed across classes with distinct concerns. It also supports the Open–Closed Principle, since a class's functionality can be extended without modifying its source code. Using decorators can be more flexible and efficient than subclassing, as an object's behavior can be augmented or combined at runtime without creating an entirely new class hierarchy. Wikipedia →
🧭 Start here: a 6-step reading path
- Read the overview: Decorator patternA 5-minute orientation
- Skim a recent paper: Effects of salinity on larval survival and development of the decorator crab Camposcia retusa and food consumption patterns of megalopaeInfluential work since 2022
- Pick up a classic book: Pattern designThe most-reprinted book on the subject
- Read the landmark paper: Decorator Pattern in Web ApplicationCited 3 times
- Go sideways: Bridge patternA closely related topic
- Go sideways: Factory method patternA closely related topic
📖 Definitions
Noun A structural (and partitioning) design pattern that allows behaviour to be added to an existing object dynamically.
🗂️ The subject at a glance
🏆 Landmark papers (most cited)
Decorator Pattern in Web Application
A Design Pattern Approach to Improve the Structure and Implementation of the Decorator Design Pattern
The Decorator Pattern in Software Engineering: Principles, Design, and Applications
A Prototype Development of a Mobile Schedule Viewer Integrating QR Code Technology and Decorator Design Pattern for Effective Dissemination of Class Schedules
A wide range of "decorator" spatter paints in many colors
CORBA-Based Class Scheduling Framework Using Decorator and Facade Design Patterns
🆕 Influential since 2022
📚 Books worth reading
Pattern designLewis Foreman Day · 1903
Some hints on pattern-designingWilliam Morris · 1899
English garden embroideryStafford Whiteaker · 1986
Singer sewing bookMary Brooks Picken · 1949
The Celtic collectionAlice Starmore · 1992
Julie Hasler's cross stitch designsJulie S. Hasler · 1994
Chinese lattice designsDaniel Sheets Dye · 1974
The art of William Morris in cross stitchBarbara Hammet · 1996
Ranked by number of editions on Open Library, a rough measure of how lasting a book is.
🔗 Related topics
- Bridge pattern The bridge pattern is a design pattern used in software engineering that is meant to "decouple an abstraction from its implementation so that the two can…
- Factory method pattern In object-oriented programming, the factory method pattern is a design pattern that uses factory methods to deal with the problem of creating objects without…
- Chain-of-responsibility pattern In object-oriented design, the chain-of-responsibility pattern is a behavioral design pattern consisting of a source of command objects and a series of…
- Prototype pattern The prototype pattern is a creational design pattern in software development. It is used when the types of objects to create is determined by a prototypical…
- Fluent interface In software engineering, a fluent interface is an object-oriented API whose design relies extensively on method chaining. Its goal is to increase code…
- Destructor (computer programming) In object-oriented programming, a destructor (sometimes abbreviated dtor) is a method which is invoked mechanically just before the memory of the object…
- Proxy pattern In computer programming, the proxy pattern is a software design pattern which is a class functioning as an interface to something else.[vague] The proxy…
- Dependency injection In software engineering, dependency injection is a programming technique in which an object or function receives other objects or functions that it requires…