Parameterized strategy pattern

  • Authors:
  • Ognjen Sobajic;Mahmood Moussavi;Behrouz Far

  • Affiliations:
  • University of Calgary;University of Calgary;University of Calgary

  • Venue:
  • Proceedings of the 17th Conference on Pattern Languages of Programs
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

The Strategy pattern decouples algorithms from the class that uses them allowing the algorithms to vary independently. It does not, however, allow the algorithms to have different parameters. The parameterized strategy pattern presented in this paper addresses the case when the algorithms have different sets of parameters, and when the user is allowed to see and modify these parameters for each concrete algorithm before its execution. This is accomplished by introducing special parameter classes which encapsulate algorithms parameters. The abstract algorithm class is completely decoupled from parameters letting each concrete algorithm class to create its own list of parameter instances which mirrors its parameters.