- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 155字
- 2021-06-25 20:52:36
The chain-of-responsibility pattern
Computer software is for processing information, and there are different ways of structuring and processing that information. We already know that when we talk about object-oriented programming, we should assign a single responsibility to each class in order to make our design easy to extend and maintain.
Consider a scenario where multiple types of operations can be performed on a set of data that comes with a client request. Instead of adding information about all the operations in a single class, we can maintain different classes responsible for the different types of operations. This helps us keep our code loosely coupled and clean.
These classes are called handlers. The first handler will receive the request and take a call if it needs to perform an action, or pass it on to the second handler. Similarly, the second handler checks and can pass on the request to the next handler in the chain.
- Oracle WebLogic Server 12c:First Look
- Learn Blockchain Programming with JavaScript
- 從零開始:數字圖像處理的編程基礎與應用
- PHP基礎案例教程
- Java從入門到精通(第4版)
- 編寫高質量代碼:改善C程序代碼的125個建議
- Building a Recommendation Engine with Scala
- Domain-Driven Design in PHP
- GitHub入門與實踐
- Java程序設計與項目案例教程
- Building Business Websites with Squarespace 7(Second Edition)
- Penetration Testing with the Bash shell
- Mapping with ArcGIS Pro
- Building UIs with Wijmo
- 精益軟件開發管理之道