Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applying Aspect Oriented Programming

I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around Castle Windsor and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attributes. I was told at the weekend to have a look at PostSharp as it's supposed to be a "better" solution. I've had a quick look at PostSharp, but I've been put off by the Attribute usage.

Has anyone tried both solutions and would care to share their experiences?

like image 677
Chris Canal Avatar asked Sep 15 '08 13:09

Chris Canal


People also ask

What is the use of Aspect-Oriented Programming?

AOP (aspect-oriented programming) is a programming style that can be adopted to define certain policies that in turn are used to define and manage the cross-cutting concerns in an application. In essence, it's a programming paradigm that enables your application to be adaptable to changes.

What is meant by Aspect-Oriented Programming?

Aspect-oriented programming (AOP) is an approach to programming that allows global properties of a program to determine how it is compiled into an executable program. AOP can be used with object-oriented programming ( OOP ). An aspect is a subprogram that is associated with a specific property of a program.

What languages support Aspect-Oriented Programming?

Aspect Oriented Programming and Java AOP has been implemented in different languages (for example, C++, Smalltalk, C#, C, and Java). Of course, the language that gains a great interest of the research community is the Java language. The following is a list of tools that support AOP with Java: AspectJ.

What is aspect oriented software development process?

Aspect-oriented software development (AOSD) is a software design solution that helps address the modularity issues that are not properly resolved by other software approaches, like procedural, structured and object-oriented programming (OOP).


1 Answers

Couple of minor issues with PostSharp...

One issue I've had with PostSharp is that whilst using asp.net, line numbers for exception messages are 'out' by the number of IL instructions injected into asssemblies by PostSharp as the PDBs aren't injected as well :-).

Also, without the PostSharp assemblies available at runtime, runtime errors occur. Using Windsor, the cross-cuts can be turned off at a later date without a recompile of code.

(hope this makes sense)

like image 161
Stacy A Avatar answered Oct 28 '22 04:10

Stacy A