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

后端 未结 11 1907
[愿得一人]
[愿得一人] 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:31

    1. keyword 'extends' - static extension.
    2. Decorator pattern - dynamic extension.
    3. Chain Of Responsibility pattern - just processing of a command object with a set of processing objects and those objects don't know each other.

提交回复
热议问题