Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Built-in AOP in C# - is it on the way?

Tags:

c#

.net

aop

In large apps I find myself really wishing I had built-in AOP facilities. As it stands in C# the best you can do is factories and RealProxys, PostSharp, ICorDebug, ICorProfiler or injection frameworks. There is no clean built-in way of doing AOP.

Is there any indication anywhere (blog post / internal discussion) that indicates that AOP is on the way?

like image 260
Sam Saffron Avatar asked May 07 '09 09:05

Sam Saffron


People also ask

What is AOP used for?

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.

Is AOP 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.

Is AOP used in Spring boot?

Spring Boot Starter AOP is a dependency that provides Spring AOP and AspectJ. Where AOP provides basic AOP capabilities while the AspectJ provides a complete AOP framework. In the next section, we will implement the different advices in the application.


1 Answers

Romain's answer covers (almost :) perfectly the current solutions. As for the future support, Anders Hejlsberg has previously stated that they'were in wait & see mode about AOP.

We can only hope that with the managed rewrite of csc, and a «Compiler as a Service», one could plug into the compiler, and inject aspects there.

like image 59
Jb Evain Avatar answered Oct 14 '22 15:10

Jb Evain