August 2016
Intermediate to advanced
635 pages
14h 5m
English
The strategy pattern allows for replacing an entire algorithm with a complimentary one. Frequently, replacing the entire algorithm is overkill: the vast majority of the algorithm remains the same in every strategy with only minor variations in specific sections.
The template method pattern is an approach which allows for some sections of an algorithm to be shared and other sections implemented using different approaches. These farmed out sections can be implemented by any one of a family of methods:

The template class implements parts of the algorithm and leaves other parts as abstract to later be overridden by classes which extend ...
Read now
Unlock full access