In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "which parts of the web responsibility chain model". The editor shows you the operation process through the actual case, the operation method is simple and fast, and the practicality is strong. I hope this article "which parts of the web responsibility chain model consists of" can help you solve the problem.
Applicability
The chain of responsibility model applies to the following situations:
There are multiple objects that can handle a request, and which object handles the request is up to the object itself.
While an object processes a request, it can also decide whether to pass the request to subsequent objects.
structure
Participant
Handler
-defines an interface to handle requests.
-manage successor nodes (follow-up chain is formed after multiple nodes are cascaded)
ConcreteHandler
-you can choose whether or not to process received requests.
-you can choose whether or not to pass the request to the successor.
-generally speaking, processing and subsequent delivery are mutually exclusive, but this is not a requirement of the chain of responsibility itself.
Client
-the originator of the request.
A possible object structure is shown below:
It should be noted that in practical applications, as long as the transmission path of the request forms a chain structure. This is not necessarily the case with the data structure itself.
Collaboration
The request made by the customer spreads along the chain path, and the nodes in the chain decide whether to process or propagate the request backward.
Effect.
The proposer of the request does not need to care about which object will process the request, or even know if any object will process the request.
Whether or not to process a request is decided by the node on the propagation chain. Therefore, the processing process of the request can be changed by changing the processing content of the node on the transmission path or directly replacing the node. And either way can be done while the program is running.
Although the responsibility chain model can greatly improve the flexibility of request processing, the opposite of this flexibility is uncertainty. When making a request, the customer does not even know if an object will process the request. If some requests have to be processed, you need to guarantee this when generating the data structure. Of course, whether there is actually an object that handles the request can be confirmed by returning a value.
This is the end of the introduction to "what are the components of the web chain of responsibility model"? thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.