- 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.
- 程序設計與實踐(VB.NET)
- PostgreSQL for Data Architects
- 我的第一本算法書
- VMware vSphere 6.7虛擬化架構實戰指南
- Hands-On Natural Language Processing with Python
- 單片機C語言程序設計實訓100例
- Instant Lucene.NET
- Lighttpd源碼分析
- Spring Boot+Vue全棧開發實戰
- Python 3.7從入門到精通(視頻教學版)
- Kubernetes進階實戰
- Mastering Apache Storm
- Instant Pygame for Python Game Development How-to
- Java EE輕量級解決方案:S2SH
- Getting Started with Windows Server Security