- Motivation
- To implement common pre- and post-processing steps around Web page requests?
- Summary
- It is an application of Chain of Responsibility Pattern.
- Create a chain of composable filters to implement common pre-processing and post-processing tasks during a Web page request.
- In some contexts, the term Intercepting Filter is associated with a specific implementation using the Decorator pattern
- A straightforward implementation of Intercepting Filter is a filter chain that iterates through a list of all filters. The Web request handler executes the filter chain before passing control to the application logic
Intercepting Filter class diagram | Intercepting Filter sequence diagram | | |
- When to Use
- TODO
- Types/Variants
- Event-Driven Filters: It uses multiple Filter Chains one for each processing events and filter implementation are stateless.
- Implementation
- TODO
- Example
- TODO
- Related Patterns
- Front Controller.Intercepting Filter is commonly used in combination with Front Controller.
- Decorator: An interesting alternative implementation to the Intercepting Filter pattern uses the Decorator pattern around a Front Controller.
- Related Technologies
- TODO
- Specific Considerations
- Decorator Vs Intercepting Filter
- The key difference between Intercepting Filter and Observerlies in the fact that the observer generally does not modify the source object; it "observes" passively what is going on in the source object.
- The purpose of Intercepting Filter, on the other hand, is to intercept and modify the context in which it is called.
- References
- MSDN: Intercepting Filter Pattern
- MSDN:Implementing Intercepting Filter in ASP.NET Using HTTP Module.
|
|