April 2026
Intermediate
491 pages
18h 4m
English
Origin: Gang of Four—Behavioral Pattern
The strategy pattern belongs to the category of behavioral patterns. This pattern allows the implementation of a family of algorithms, each of which is encapsulated in a separate class. This encapsulation enables these algorithms to be changed independently, making them interchangeable.
In this example, a small craft business has decided to sell its products through an online store. Initially, the store only offered payment by credit card. The corresponding code was integrated directly into the shopping cart component, and the payment process was implemented accordingly.
Due to the excellent quality of the products, sales figures are now increasing, and the ...
Read now
Unlock full access