Interception

Hello everybody,

today I want to write few words about Interception.

First of all one of the questions that requires consideration can be why we may need interception at all? Need in interception arises in cases when we have some kind of logic, that is dispersed around whole application. Some candidates for interception can be:

  • Logging
  • Authorization
  • Validation
  • Exception handling
  • Caching
  • Performance collecting and analysis

etc.... . So, after knowing at which places interception can be used following statement can be considered as explanation: interception is inserting code between calling code and target object. Code can be inserted before or after method call. If code is inserted before call then we have access to input variables, if code is intercepted then we have access to output.

There are following types of interception ( at least interceptions that I was able to find )

  1. Instance interception
  2. Type interception

No Comments

Add a Comment