Aspect-oriented approaches targeting the .NET Framework
Introduction
This is an incomplete list of frameworks and tools supporting aspect-oriented programming under the .NET framework. It is separated by technology. The comments stated below are sometimes just copied form the author’s website, to those are not necessarily objective evaluations! If you find anything is missing or this site could be improved in any other way, please sent your comment to Eric Bodden.
You can find our related (German) article here: Torsten Weber und Eric Bodden – bit-Fabrik: Zweigstelle, Hauptstelle, Dienstleister: Aspektorientierte Programmierung mit .NET.
Proxy-based approaches
Aspect#
Project URL: http://aspectsharp.sourceforge.net/
Aspect# is an AOP (Aspect Oriented Programming) framework for the CLI (.Net and Mono). It relies on DynamicProxy and offers a built-in language to declare and configure aspects, and is compliant to AopAlliance. It became part of the Castle Project in June 2005. Main Features: – Custom mini configuration language, not xml. – Mix/Intercept classes and methods through dicnamic proxy approach. Restrictions: – Classes to be created dynamic proxy for shouldn’t be sealed and only virtual methods can be intercepted. – Using intercepted classes is not completely transaparent to users that users should explicit create the dynamically proxied class through the AspectEngine. – No static weaving support.
Encase AOP
Project URL: http://theagiledeveloper.com/articles/Encase.aspx
Encase is an aspect oriented programming framework for the .NET Platform written in C#. Encase is unique in that it provides aspects to be applied during runtime in managed code rather then being configuration file based that other AOP frameworks rely upon. The advantage of applying aspects in this way is that it promotes productivity to developers new and/or unfamiliar with AOP. Restrictions: – Encase cannot mixin multiple classes that implement a shared interface? For instance, if class A implements Ialphabet, and class B implements Ialphabet, classes A and B can not both be mixed in as an aspect. – Encase can only provide interception and aspect weaving to virtual (overriable) methods and properties. – Encase is unable to apply aspects to sealed (NotInheritable) classes.
Puzzle Framework
Project URL: http://www.puzzleframework.com/
No further information available at the moment.
The Orthogonal Weaving Model
Presentation URL: http://janus.cs.utwente.nl:8000/twiki/ pub/AOSDNET/WorkshopSlides/HuseinArmouti.ppt
The Orthogonal Weaving Model (OWM) is a dynamic framework by which .NET developers can implement aspects. OWM does not add any language extensions and as such does not require any special source code parsing or attribute programming. Core functionality and aspect are both native .NET classes; advice can be any method of any class in any assembly. Weaving rules are configured in an XML file or programmatically. Weaving is done dynamically upon calling the AspectWeaver.NewInstance() function on a type for the first time; System.CodeDom and System.Reflection namespaces are utilized to generate an in-memory assembly to host the woven class, which acts as interceptor. OWM provides state-dependent advice activation where advice methods are conditionally activated. Componentized aspects eliminate the need to redeploy or shutdown the system when a change is required; a file system watcher monitors the weaving rules file for changes.
XL-AOF
Paper URL: http://portal.acm.org/citation.cfm?id=1101562&dl=ACM&coll=portal
XL-AOF is an AOP approach targeted at distributed computing.
Spring.NET
Spring, the popular application framework now also features aspect-oriented programming, though proxies and a runtime weaving approach.
Weaving-based approaches
Aspect.NET
Presentation URL: http://research.microsoft.com/workshops/sscli2005/presentations/safonov.ppt
Download URL: http://www.msdnaa.net/curriculum?id=6595
based on phoenix; code annotated; language-agnostic; very good IDE integration
AspectDNG
Project URL: http://aspectdng.tigris.org/
- looks quite mature – allows even context exposure via JoinPoint object; “AspectDNG is a .NET aspect weaver, that’s to say a tool that can “transplant” code into an existing assembly. This transplant is made after the standard .NET compilation, which means that both aspect and the so called “base” code (the one the transplant will be operated on) can be developped in any programming language that is compatible with .NET CLS. Another way to say that: AspectDNG works on assemblies (EXE or DLL) that may have been created out of C#, VB.NET, Eiffel.NET, Mananged C++… Main Features: – Xml, Xpath based configuration file format. – IL level static Weaving. – Custom xml based disassembled language ILML which can be used to convert assemblies to and be modified/combined and then converted to assemblies. Restrictions: – Static weaving only.”
Compose*
Project URL: http://janus.cs.utwente.nl:8000/twiki/bin/view/Composer/WebHome
Compose* (or: ComposeStar) is a project that aims at enhancing the power of component- and object-based programming, so that software becomes easier to structure and modularize, hence easier to develop, maintain and extend. In particular, Compose* offers aspect-oriented programming (http://aosd.net) through the composition filters model (http://trese.cs.utwente.nl/composition_filters). The goals and concerns of this project are summarized as the ComposeStarMission. Currently (version 0.5), Compose* is an extension to Microsoft Visual Studio, enhancing classes written in C# and J# (i.e. Java) to ‘concerns’. A concern ‘wraps’ a .NET class and allows for adding composition filters, and expressing crosscutting among concerns (by superimposing filters on other classes). CompositionFiltersExplained contains more information.
Loom.NET
Project URL: http://www.dcl.hpi.uni-potsdam.de/research/loom/
The LOOM .NET project aims to investigate and promote the usage of AOP in the context of the Microsoft .NET framework. We have been developing two AOP tools (so called weavers) that all implement different approaches to weaving: A runtime weaver crating weaved objects on the fly and a static weaver. Main Features: – Support under .Net Framework 2.0 beta – Include both dynamic proxy based dynamic interception and il level rail like static weaving support.
AspectC#
Project URL: http://www.dsg.cs.tcd.ie/index.php?category_id=169
No further information available at the moment.
Setpoint
Project URL: http://lafhis.dc.uba.ar/
Claims to have “semantic pointcuts”.
Weave.NET
Project URL: http://www.dsg.cs.tcd.ie/index.php?category_id=194
No further information available at the moment
SourceWeave.NET
Project URL: https://www.cs.tcd.ie/publications/tech-reports/reports.04/TCD-CS-2004-35.pdf
No further information available at the moment
Wicca & Phx.Morph
Project URL: http://www.columbia.edu/~me133/
No further information available at the moment
PostSharp
Project URL: http://www.postsharp.org/
Postsharp is an aspect-oriented tool for .NET. The low-level code weaver allows to inject directly MSIL instructions at join points (it requires a serious understanding of MSIL). PostSharp Laos uses custom attributes to define and apply aspects (requires only a basic knowledge of System.Reflection.
Fully-fleged compilers
EOS
Project URL: http://www.cs.virginia.edu/~eos/
Article URL: http://www.codeproject.com/KB/architecture/aop2.aspx
feels very much like AspectJ; supports instance-based bindings (“per-object”); variations: EOS-U (“Classpacts”), EOS-T for testing
Delphi Prism/Cirrus (added Sep. 9th, 2010)
Project URL: http://www.embarcadero.com/products/delphi-prism
a .NET compiler with AOP built-in






[...] ישנן כמה ספריות AOP לדוט נט. (ואני מניח שזו רשימה חלקית) ועוד רשימה [...]
I am a young software engineer interested in learning AOP. Could you please let me know which is the best (and free) tool for starting AOP with .NET?
I am sorry, but that’s hard to tell. Firstly, I think it really depends on your particular problem at hand. Secondly, I have not looked at .NET systems during the last two years, and I guess they may have evolved a lot since then.
Thanks for the quick reply. I am working with .NET 2.0 (more than 2 year old). I am just learning. There is no specifc problem at hand.
I expect some good advise from you, if you can find some time. Could you please suggest a tool that has some good reference implementation?
Is there an article that gives difference b/w Weaving and Proxy? Which is good.
I found, this article to be unique. It would be great if you can update this frequently with latest updates and references to sample implementation. Then it can grow as a sigle point of reference for AOP with .NET.
Thanks
Lijo
The most well advertised AOP framework for .NET that I am aware of is Postsharp. They also have a quite decent documentation, opposed to most other tools.
I am not aware of any articles that make a proper comparison between weaving and proxies, apart from ours, which is in German.
Thanks. I will expreiment with that and get back to you with more questions
Hi, I think as well that Postsharp is a good tool. Just google for more information and for documentation. It is well worth it…:-)
[...] .NET Aspect-oriented Approaches (Eric Bodden, Ph.D.) Aspect# is an AOP (Aspect Oriented Programming) framework for the CLI (.Net and Mono). It relies on DynamicProxy and offers a built-in language to declare and configure aspects, and is compliant to AopAlliance. [...]