Catel.Extensions.Interception

Interception Extensions enables you to write code that is executed each time a matching method is invoked using a fluent API. It's suited for cross cutting concerns, such as transactions, security and logging.


Interception provides the following advantages:

  • Strongly-typed syntax 
    Interception semantics are based on strongly-typed method definitions, which permit to develop aspects taking advantage of features like: auto-completion, refactoring, compile-time errors, etc ;
  • No configuration
    We tried to simplify AOP implementation by favoring convention over configuration. As a result, no configuration of any kind is ever required to build aspects. However, some conventions take place to make this possible ;
  • Minimum learning-curve
    In order to get started, no previous experience with this or any other AOP implementation is required. No need to know or understand AOP terminology, which is not always very intuitive. By looking at some examples developers can figure out how to intercept calls and modularize their own applications ;
  • Methods as first-class elements
    Utilizing dynamic proxies to implement AOP typically results in having to model aspects as interceptors. Such interceptors are commonly associated with objects no with methods. Therefore, the developer is responsible for providing the logic to break down object interception into method interception;
  • Usage in combination with IoC
    The interception mechanism in Catel is based on the registration of a type in the ServiceLocator and in addition of the interception configuration, this way, you can fully use the advantages of IoC.

Initially, Interception extension support Methods and Properties members for the types you register in the ServiceLocator (internally, we create an class proxy instance which is actually registered in ServiceLocator).

This extension is based on FluentAop