InfoQ

News

Aspect Oriented Programming for Silverlight

Posted by Jonathan Allen on Aug 04, 2008 06:49 PM

Community
.NET
Topics
AOP
Tags
Mono,
.NET Compact Framework

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.

No comments

Reply

Exclusive Content

Agile and Beyond - The Power of Aspirational Teams

Tim Mackinnon talks about the aspirations behind the Agile principles and practices, the desire to become efficient, to write quality code which does not end up being thrown away.

Concurrency: Past and Present

Brian Goetz discusses the difficulties of creating multithreaded programs correctly, incorrect synchronization, race conditions, deadlock, STM, concurrency, alternatives to threads, Erlang, Scala.

ActionScript 3 for Java Programmers

Often the hardest part of changing technologies is language syntax differences. This new article provides Java developers with a transition guide to Actionscript which forms the foundation of Flex.

Neal Ford On Programming Languages and Platforms

Neal Ford talks about having multiple languages running on one of the two major platforms: Java and .NET. He also presents the advantages offered by Ruby compared to static languages like Java or C#.

Future Directions for Agile

David Anderson talks about the history of Agile, the current status of it and his vision for the future. The role of Agile consists in finding ways to implement its principles.

Nick Sieger on JRuby

Nick Sieger talks about the future of JRuby, Java Integration, and his work on JEE deployment tools for Ruby on Rails like Warbler.

Rustan Leino and Mike Barnett on Spec#

Rustan Leino and Mike Barnett of Microsoft Research discuss the technology in Spec# and its futures.

10 Ways to Screw Up with Scrum and XP

Henrik Kniberg talks about 10 possible reasons to fail while doing Scrum and XP. Maybe the team does not have a definition of what Done means to them, or they don't know what their velocity is.