There are a lot of questions on SO comparing Bridge pattern and Strategy pattern. Explanations include
Bridge is structural and Strategy is behavioral
and
UML and code look similar but the intent is different
among other less common ones.
None of those explanations I've come across here or elsewhere is satisfactory. I clearly know when I am using the Strategy pattern and Bridge pattern because of my intention and the problem I need to solve but from a distance, the distinction gets blurred. Thus, this question keeps my mind busy time to time.
If I use the Bridge pattern when modeling the structure of the components, doesn't it become Strategy pattern in runtime, naturally?
Aucun commentaire:
Enregistrer un commentaire