dimanche 27 juin 2021

questions about strategy pattern

the definition of the context in the strategy pattern is: 1-is configured with a ConcreteStrategy object 2-maintains a reference to a Strategy object 3-may define an interface that lets Strategy access its data. "may define an interface that lets strategy access its data" can someone explain that to me, and in the definition of the strategy pattern "let the algorithm vary from the class using it" what does that mean too and in pros of this pattern "You can replace inheritance with composition" what does mean and thank you!

Aucun commentaire:

Enregistrer un commentaire