Why would I ever use a Chain of Responsibility over a Decorator?

后端 未结 11 1926
[愿得一人]
[愿得一人] 2020-12-04 12:58

I\'m just reading up on the Chain of Responsibility pattern and I\'m having trouble imagining a scenario when I would prefer its use over that of decorator.

What do

11条回答
  •  无人及你
    2020-12-04 13:21

    I think the situations to apply these two patterns are different. And by the way, for decorator pattern, the decorator should know the component which it wrapped. And for CoR, the different interceptors could know nothing of each other.

提交回复
热议问题