Third Shelf

Proxy aspect requirements

Posted in .net, aop by Sydney du Plooy on April 2, 2008

Problem:

A business software package has cross-cutting functionality across its domain objects. This leads to duplicated code and needs to be generalised.

Solution:

Produce a general proxy aspect framework for applying aspects to domain objects.

Note: The framework that we are going to construct is for a specific scenario and is not intended to compete with other aspect oriented frameworks out there. It is intended to demonstrate the principles and considerations that need to be taken into account when applying aspects to domain objects.

Prerequisite:

Every domain object must be defined by an interface.

Requirements:

At a high level our requirements for the proxy aspect framework are as follows:

  • Support multiple aspects per domain object;
  • Generated proxy must at least implement the domain objects interface;
  • Support aspects that need to implement their own interfaces on the proxy;
  • Collections must be applied the same aspects as the domain object it is defined on;
  • Proxy types must be cached;
  • Support the ability to place intercepting calls before and/or after the call to the target instance;
  • Must be able to save the assembly containing all proxy types;
  • Must be able to intercept methods, events and properties.

Next, we will discuss the framework design.


Tagged with: ,

One Response

Subscribe to comments with RSS.

  1. Unblock Me said, on January 29, 2009 at 8:03 PM

    Just wanted to thank you for a really good post. I found it quite useful and will check your site often.


Leave a Reply