{'fraction_non_alphanumeric': 0.010970464135021098, 'fraction_numerical': 0.0, 'mean_word_length': 5.209424083769633, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Strategy Configuration Problem and How to Solve It

The Strategy pattern allows the developer to implement a family of algorithms that can be used interchangeably and vary independently from the objects that use them. To achieve this, the algorithms are implemented as an hierarchy of respective strategy classes that realize the same interface. One particular issue that is not precisely specified in the pattern is how to configure objects with the algorithms that they need to use. This paper introduces recurring solutions to the problem. These solutions appeared in different projects delivered in the context of Software Engineering, a compulsory course of the Department of Computer Science and Engineering of the University of Ioannina. The reported solutions are of two kinds, those that facilitate the constant configuration of objects with algorithms that do not change during the lifetime of the objects, and those that enable the adaptable configuration of objects with algorithms that can be dynamically reconfigured. The solutions that adhere to the intent of Strategy are reported as patterns, while the solutions that deviate from it are reported as anti-patterns.