August 2018
Intermediate to advanced
248 pages
5h 51m
English
Reaching an airport to catch a flight is a good Strategy example used in real life:
There are trade-offs between cost, time, convenience, and so forth.
In software, Python's sorted() and list.sort() functions are examples of the Strategy pattern. Both functions accept a named parameter key, which is basically the name of the function that implements a sorting strategy [Python 3 Patterns, Recipes, and Idioms, by Bruce Eckel-08, page 202].