Monday, 3 July 2017

Software Engineering: Decorator Pattern

Structural Pattern - Decorator Pattern

Intent
Attach additional responsibilities to an object dynamically.  

Why is this used?
Decorators provide a flexible alternative to sub-classing for extending functionality.


UML diagram representation


https://www.tutorialspoint.com/design_pattern/images/decorator_pattern_uml_diagram.jpg

Source code example

https://www.tutorialspoint.com/design_pattern/decorator_pattern.htm
More to follow...

No comments:

Post a Comment

Software Engineering: Bad Smells! (Smelly code)

Bad Smells! What are bad smells? This refers to any symptom in the source code of a program that possibly indicates a deeper problem.  ...