Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are your real world uses for Aspect Oriented Programming?

Tags:

aop

I'm stumped as to why adoption of AO has been so slow. There are plenty of rich implementations out there for the predominant languages. My guess is that, like OO in it's day, it is enough of a paradigm shift that people don't recognize the places where it could be helping them.

So, beyond non-invasive logging, what are some of the ways that you have used, or plan to use AO, that reduces complexity, improves maintenance, enhances system "ilities"?

like image 316
Chris Noe Avatar asked May 11 '09 20:05

Chris Noe


People also ask

What is Aspect-Oriented Programming used for?

Aspect-oriented programming is a technique for building common, reusable routines that can be applied applicationwide. During development this facilitates separation of core application logic and common, repeatable tasks (input validation, logging, error handling, etc.).

Is aspect-oriented programming still used?

Nowadays I see some AOP still around, but it seems to have faded into the background. Even Gregor Kiczales (inventor of AOP) called it a 15% solution. So I guess AOP has its reason for existence, but it depends on the individual developer to use it the right way.

Which of the following is an advantage of Aspect-Oriented Programming?

Advantages of AOP Your service/domain classes get advised by the aspects (cross cutting concerns) without adding any Spring AOP related classes or interfaces into the service/domain classes. Allows the developer to concentrate on the business code, instead the cross cutting concerns.

What is Aspect-Oriented Programming in simple terms?

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.


1 Answers

I am currently using AOP via EntLib / Unity in production for:

  • logging
  • caching
  • security
  • exception reporting
  • performance counters

Take a look at http://www.agileatwork.com/unit-of-work-with-unity-and-aspnet-mvc/ for an implementation of the unit of work pattern with AOP

[UnitOfWork]
public void Process(Job job)
{
    ...
}
like image 92
Mike Valenty Avatar answered Sep 21 '22 20:09

Mike Valenty