lundi 5 septembre 2022

How to implement strategy pattern here?

I came across an article about LSP https://stackify.com/solid-design-liskov-substitution-principle/ . It seems that a strategy pattern could be implemented here but I cannot see how to implement it.

My idea is to let the brewCoffee be the strategy method, in which i state what kind of coffee should be brewed. The following is an overview over the design,enter image description here

Any quick and short suggestions?

Aucun commentaire:

Enregistrer un commentaire