A Gang of Four structural design pattern that attaches additional responsibilities to an object dynamically by wrapping it in another object sharing the same interface, offering a flexible alternative to creating a new subclass for every combination of added behavior.
Facts
Core PrincipleAttaches additional behavior to an individual object dynamically, without affecting other instances of the same class, as a flexible alternative to subclassing. 2 Connections
Associated With
Erich Gamma, Pioneers Erich Gamma co-authored the 1994 Design Patterns book that named and catalogued the Decorator pattern among the original 23.
In Field
Sources
1. Wikipedia: Design Patterns (book)
Wikimedia FoundationLead section, first sentenceQuote, Lead section, first sentence
Design Patterns: Elements of Reusable Object-Oriented Software (1994) is a software engineering book describing software design patterns.
View the Source 2. Wikipedia: Decorator Pattern
Wikimedia FoundationLead section, first sentenceQuote, Lead section, first sentence
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.
View the Source Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.