Doctor
Doctor

Reputation: 168

Reflect Oriented and Aspect Oriented in .Net and C#

Does .Net framework and specially C# language supports Reflect Oriented Programming and Aspect Oriented Programming?

Upvotes: 3

Views: 496

Answers (2)

Regfor
Regfor

Reputation: 8101

Yes, .NET itself support AOP and Reflect Oriented Programming.

Reflect Oriented Programming using reflection and System.Reflection namespace.

For AOP there are multiple ways. And only remote proxies and deriving from ContextBoundObject are supported by .NET Framework itself, but not recommended to use for AOP due to their performance. All other possibilities using 3rd party libraries.

  • Approach using Remoting Proxies
  • Deriving from ContextBoundObject
  • Compile-time subclassing (Rhino Proxy)
  • Runtime subclassing( Castle Dynamic Proxy )
  • Hooking into the profiler API( Type Mock )
  • Compile time IL-weaving ( Post Sharp / Cecil )
  • Runtime IL-weaving ( Post Sharp / Cecil )

Upvotes: 2

Matthew Groves
Matthew Groves

Reputation: 26169

Reflection, yes: you can use the System.Reflection namespace.

Aspect-oriented Programming is not really supported by .NET/C# as is, you'll need a third party tool for that. Some popular examples are PostSharp and Castle DynamicProxy.

Upvotes: 0

Related Questions