Notice that payment method of shopping cart requires payment algorithm as argument and doesn’t store it anywhere as instance variable.
Wzorzec strategii jest przydatny, gdy mamy wiele algorytmów dla konkretnego zadania i chcemy, aby nasza aplikacja elastycznie wybierała dowolny algorytm w czasie wykonywania dla konkretnego zadania.
Strategy pattern is useful when we have multiple algorithms for specific task and we want our application to be flexible to chose any of the algorithm at runtime for specific task.