Tags » Design Patterns
Today we will try to understand Strategy Pattern with the help of an example.
The example we will consider is The Game of Chess. The intention here is to explain strategy pattern and not to build a comprehensive Chess Game solution. 441 more words
Attach additional responsibilities to an object dynamically. Decorator provides flexible alternative to sub classing for extending functionality.
Example from Text Book:
The following example taken from “Heads First Design Pattern” book. 7 more words
Transforming Collections with Decorators
The Decorator Pattern
Ever since first learning the programming design patterns, the decorator pattern has been my favorite. It seemed such a novel idea to me, and so much more interesting than the others. 1,172 more words