嗨,我想知道责任范围的链。链责任范围
通常它是一种具有本身处理的公共使用模式与每个处理程序使所述功能动作到它的主管。
我在示例场景看到的是:
"Only one related handler is handling the functionality itself and all the other handlers
are just passing through to their supervisor handler."
是否违反责任链模式在这种情况下:
"Every handler has the responsibility to take an action instead and after that passing
to supervisor.
作为一个抽象:
Chain of Responsibility Recommended Scenario:
Handler1(Take No Action) --> Handler2 (Take No Action) --> Handler3(Take All Action)
Chain of Responsibility Wondering Scenario:
Handler1(Take Partial Action) --> Handler2(Take No Action) --> Handler(Take Partial Action)
第二种情况适合责任链还是违反责任?
对于实例的Netty对自己有处理程序和所有有他们采取负责任的行动,他们也将信息传递本身之间。我们可以说Netty处理机制适合责任链吗?