Functions | |
def | Strategy_Exercise () |
Example of using the Strategy Pattern. | |
Variables | |
list | entries |
List of individuals to play around with in the Strategy exercise. | |
def Strategy_Exercise | ( | void | ) |
Example of using the Strategy Pattern.
The Strategy pattern provides a way to easily assign different algorithms to a class instance that can be changed at the time the class is created.
In this exercise, the Strategy_ShowEntries_Class instance sorts and displays a list of EntryInformation elements. Three different sorting strategies are provided (Name, Age, Height) and an option to reverse the normal order of the sort.
Definition at line 34 of file strategy_exercise.py.
list entries |
List of individuals to play around with in the Strategy exercise.
Definition at line 13 of file strategy_exercise.py.