CSC/ECE 517 Fall 2007/wiki1b 8 ktrk

From Expertiza_Wiki
Revision as of 01:10, 1 October 2007 by Rwkanne (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

In the book on design patterns by the Gang-of-Four (Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides), situations (also labeled "code smells" by Martin Fowler) are described where the strategy design pattern could be used to architect a better solution. These include:

1. A class that exhibits many behaviors

2. A class that uses many variations of an algorithm

3. A class that uses data structures related to a behavior but not the class

4. Many similar classes that differ only in a type of behavior

Strategy Pattern Implementation in Java and Ruby

Comparison of Implementations

References

http://en.wikipedia.org/wiki/Strategy_pattern