Design Patterns: Strategy
Define multiple algorithms and let client application pass the algorithm to be used as a parameter.
See:
- HFDP Chapter 1
java.util.Comparator
as an example: https://www.journaldev.com/1754/strategy-design-pattern-in-java-example-tutorial
Related topics:
- Design Patterns: Strategy—Define multiple algorithms and let client application pass the algorithm to be used as a parameter.