课程: Python: Design Patterns (2021)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Chain of responsibility
- [Narrator] The chain of responsibility pattern opens up various possibilities of processing for a given request. The chain of responsibility pattern decouples the request and its processing. Our problem is that many different types of processing need to be done depending on the request. In our scenario, we receive an integer value. We use different handlers to find out its range. As our solution, we use an abstract handler that stores a successor that will handle a request if the current handler doesn't handle it. Concrete handlers check if they can handle the request. If they can, they handle it and return a true value, indicating that the request was handled. Composite is related to the chain of responsibility, design pattern.
内容
-
-
-
-
-
-
(已锁定)
Observer1 分钟 5 秒
-
(已锁定)
Observer example6 分钟 22 秒
-
(已锁定)
Visitor56 秒
-
(已锁定)
Visitor example6 分钟 42 秒
-
(已锁定)
Iterator1 分钟 15 秒
-
(已锁定)
Iterator example4 分钟 32 秒
-
(已锁定)
Strategy40 秒
-
(已锁定)
Strategy example5 分钟 44 秒
-
(已锁定)
Chain of responsibility1 分钟 4 秒
-
(已锁定)
Chain of responsibility example5 分钟 57 秒
-
(已锁定)
-
-