BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Aspect Oriented Programming for Silverlight

| by Jonathan Allen on Aug 04, 2008. Estimated reading time: less than one minute |

AOP or Aspect Oriented Programming allows developers to “weave” code fragments through their object and methods without explicitly placing the code in the class’s source. This additional code, often referred to as “advice”, is often stored in configuration files but other options exist. Probably the most widely AOP system is AspectJ, an extension for Java.

AOP has been controversial over the years. While many people swear by it for mundane tasks like security and logging, others balk at injecting code that cannot be easily viewed in the source. But even if you don’t like it, sooner or later chances are you are going to happen across code that uses it.

For .NET developers current using AOP or interested in trying it out, one option is PostSharp. PostSharp uses post-processing to add advice to classes. This involves modifying the compiled EXE or DLL to inject the necessary code fragments. For PostSharp, advice is usually indicated by Attributes.

Recently it has been announced that PostSharp 1.5 supports Silverlight 2. This CTP release also includes support for .NET Compact Framework and Novell’s Mono. Chris Koenig shows some examples of PostSharp.

Rate this Article

Adoption Stage
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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT