Can aspect-oriented programming be a positive addition to the C # language?

I had interesting discussions with my colleagues about the merits, if you include aspect-oriented programming as a native C # language paradigm.

The debate seems to be divided into three camps:

  • Those people who think that C # is already too complicated, and another important feature, such as AOP, will only pollute the water.
  • Those who think that this will be a great addition, because everything that can increase the expressiveness of the language without violating the existing ones is good.
  • Those who do not consider this necessary because libraries such as PostSharp that compile IL-weave already allow this in a neutral language.

I'm curious what the C # / developer communities think. NET

+3
source share
3 answers

I agree with the first camp. C # is already loaded with features. Use PostSharp instead .

+2
source

It would be great if languages ​​simplified the development and use of AOP extensions.

For example:

  • It would be nice if you could provide a delegate (or an anonymous method or lambda) as a parameter for a custom attribute. It is not much work to implement this in C #, it is quite easy to implement it in the CLR (since it supports types, not methods?). And that would allow the expression of "pointcuts" in an elegant way.

  • "fieldof" "methodof". CLR ( ), #. 'eventof' 'propertyof' ( CLR).

  • .

  • ; , ( ).

, , AOP. ( , PostSharp 2.0 , #, , # 2.0). : , , . - . , (, Entity Framework ).

, , - . , JIT- (Spring/Castle); .

, : , AOP; .

+2

, -, . , .NET4, .

, , .

, , #, , -, Java-, , .

, , .NET, - AOP, , , , AJDT Eclipse.

0
source

Source: https://habr.com/ru/post/1720713/


All Articles