mardi 21 mai 2019

Does "Strategy" design pattern violates "Open-Close" principle?

If i use switch case to execute some logic based on particular property value. This is somehow equivalent to strategy pattern. If i want to append new logic then i have to modify file which is having switch case.

Does it violates Open-Close design principle ? If yes then what is recommended here?

Aucun commentaire:

Enregistrer un commentaire