What is the difference between the bridge pattern and the strategy pattern?

后端 未结 14 2152
予麋鹿
予麋鹿 2020-11-30 20:37

I tried to read many articles on dofactory, wikipedia and many sites. I have no idea on differences between bridge pattern and the strategy pattern.

I know both of t

14条回答
  •  -上瘾入骨i
    2020-11-30 21:01

    Just to add to what has already been said about the pattern comparison (difference of intent, ...): the Bridge pattern is also intentionally structured to allow the abstraction hierarchy side to vary. In languages like C# this could imply you have an abstraction base that contains virtual methods as a way to allow intended variations that don't cause problems for existing consumers. Other than that the two patterns might appear identical for the most part.

提交回复
热议问题