P
PJ6
I've done a lot of reading on AOP lately and have come to the conclusion
that for any elegant and simple AOP design pattern to be possible, the
Framework and compiler themselves need to be enhanced. Everything currently
available is either too clumsy (proxies) or downright dangerous (unmanaged,
direct IL manipulation through the profiler API). Both are also rather too
complicated for my taste.
I would suggest enhancing the compiler to automatically and transparently
proxy when methods or method calls are tagged with attributes that implement
a verb interface such as:
Public Interface IAOPVerbProvider
Function Execute(m as MethodInvocationContext) as Object
Readonly Property BeforeOrAfter as Precedence
End Interface
where MethodInvocationContext provides nonstatic method invocation
information such as parameter values.
This is the simplest way I can think of natively supporting AOP. It's just a
musing thought, but it makes me think it wouldn't be at all a strech to
implement. I have yet to read about any serious proposals for such a
feature - does anyone know if MS has any intentions to add any native AOP
support in the future?
Paul
that for any elegant and simple AOP design pattern to be possible, the
Framework and compiler themselves need to be enhanced. Everything currently
available is either too clumsy (proxies) or downright dangerous (unmanaged,
direct IL manipulation through the profiler API). Both are also rather too
complicated for my taste.
I would suggest enhancing the compiler to automatically and transparently
proxy when methods or method calls are tagged with attributes that implement
a verb interface such as:
Public Interface IAOPVerbProvider
Function Execute(m as MethodInvocationContext) as Object
Readonly Property BeforeOrAfter as Precedence
End Interface
where MethodInvocationContext provides nonstatic method invocation
information such as parameter values.
This is the simplest way I can think of natively supporting AOP. It's just a
musing thought, but it makes me think it wouldn't be at all a strech to
implement. I have yet to read about any serious proposals for such a
feature - does anyone know if MS has any intentions to add any native AOP
support in the future?
Paul