BT

InfoQ Homepage News PostSharp 2.0 Makes Aspect-Oriented Programming Easier with IDE Support

PostSharp 2.0 Makes Aspect-Oriented Programming Easier with IDE Support

Bookmarks

AOP, or Aspect-Oriented Programming, allows developers to apply repetitive functionality to multiple classes without actually changing the source code for those classes. Instead, aspects or concerns are applied to classes indicated via attributes or configuration files. AOP first become widely popular with AspectJ and the Java programming language. Since then it has become available in most programming languages.

For .NET, AOP frameworks like PostSharp are implemented as a post-build process. This process decompiles the IL assembly, adds the additional functionality, and then recompiles it.To see the results, you then have to open it back up with a tool like Reflector.

PostSharp 2.0 adds two key features to makes it easier for AOP developers to understand their code. The first is an Aspect Browser. This allows developers to select an aspect and see all of the classes it applies to. This is done via a pair of tree views that resemble Visual Studio’s class viewer.

The second feature affects Visual Studios code editor. By hovering the mouse pointer over a class name, you can see all of the aspects that apply to it, even if it was applied to a base class. In addition, the tooltip that shows this information has links to take you to the definition of the aspect.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • PostSharp vs Others

    by rafal buch /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I am wondering if anyone compared this to other inversion of control frameworks such as Spring, or Unity and what were the thoughts in choosing one..

  • Re: PostSharp vs Others

    by David Clarke /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    AOP and IOC/DI address different issues and e.g. Spring includes support for both. IOC transfers control of object instantiation from the module that requires the object to an IOC Container. Aspects typically encapsulate common behaviour for all modules, e.g. logging and authorisation.

  • Re: PostSharp vs Others

    by ARASH GHOREYSHI /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Microsoft Unity Allow Type Interception and AOP Due to its Interception capability .

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.