1, the stencil method (Template Method) modeling sequential processing
- The method of stencil (Template Method) algorithm using an abstract parent class definitions used: the processing step, specific subclasses to achieve
- Of course, a parent can provide a default algorithm implemented as a method used
2, the chain of responsibility pattern
- Chain of Responsibility pattern is a 23 kinds of software design patterns proposed by the GoF, it is one of behavior patterns
- The model constructed a series of objects take on different responsibilities of each class to have completed a task
- Among these classes of objects as closely linked as a chain, it is referred to as duty chain.
3, Jakarta Commons sub Chain of the above two modes are combined into a processing flow of reusable Java framework for describing the procedure of
- So that the client does not need to be concerned about in the course of treatment is to use a command or a series of command
- By Liskov substitution principle, chain implement command, use the command in place can be used chain
- Mechanism is used as the basis of HTTP requests and Struts application framework processing Shale
Reproduced in: https: //my.oschina.net/u/3847203/blog/1841306