The Strategy design pattern provides a solution:
Encapsulate an algorithm in a separate Strategy object.
A class delegates an algorithm to a Strategy object
instead of implementing an algorithm directly.
Describing the Strategy design in more detail is the theme of the following sections. See Applicability section for all problems Strategy can solve.

Background Information