1. If the class is immutable, it is set to final. The method entry reference is immutable and also set to final. Prevent subsequent code from being incorrectly changed.
2. Design, can be easily extended without repairing the core code.
For example, to design a remote call framework, you can extend the function through the interceptor chain.
There is a job timer business in the project, and the server is responsible for generating job timing tasks. The client will have the machine responsible for receiving execution. Servers and clients communicate over HTTP.
At this point in the design, there can be a unified interceptor entry, and then a call chain. The core function is the corresponding class to perform the job task request, and other functions such as parameter verification, security authentication, etc. can be implemented by adding an interceptor to the interceptor chain.
Some of the principles of design