The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

akim.boyko (5) [Avatar] Offline
#1
Hi,
After I finished reading of "AOP in .NET" book, I proceed to read referenced materials and found a paper 'Aspect-Oriented Programming' by Gregor Kiczales and others to be quite interesting. Sure, the paper was written more then 15 years ago and all examples are written using Lisp, never the less most of materials could be applied to modern aspect-oriented frameworks.

But there is one of samples loop fusion which I have no idea how to implement at .Net, except for use either Roslyn or Mono.Cecil. Is there any examples using PostSharp or other AOP framework that describe how to achieve this?
matthew.groves (46) [Avatar] Offline
#2
Re: Loop fusion examples
Akim,

Kiczales and team went on to write AspectJ, which is something of a forerunner to PostSharp, so you are in the right place!

I saw your question earlier today on Stack Exchange, and the concept of "loop fusion" is new to me, especially as it relates to AOP, so I've already been asking some colleagues about it.

I will report back when I find anything helpful. In the meantime, feel free to post examples, links, or any other interesting/helpful information in this thread.

Thanks,

Matt
akim.boyko (5) [Avatar] Offline
#3
Re: Loop fusion examples
Thx Matt,
I'm looking for an examples of pointcuts other than properties and method boundaries. Based on my expirience with PostSharp, I think that it's also possible to introduce concept of "logical" pointcuts using two mentioned before (for example, intercept a call to another assembly). But the idea of pointcuts inside method was new for me. To some extend, it should be possible to use expression tree to have method boundaries pointcuts inside method boundaries.
matthew.groves (46) [Avatar] Offline
#4
Re: Loop fusion examples
It does fit the definition of a join point/pointcut, but as far as I know, there aren't any AOP tools that fit the bill for that kind of pointcut.

IL manipulation at runtime with Reflection.Emit or at compile time with Mono.Cecil/PostSharp SDK could probably do stuff along those lines. Or maybe compiler as a service (Roslyn). Perhaps even code generation tools.

Might be worth checking out the upcoming Manning book on Metaprogramming.

It's beyond my practical experience with AOP, but I'm very open to learning more about it.

-Matt
akim.boyko (5) [Avatar] Offline
#5
Re: Loop fusion examples
I did little investigation and found that there is no "loop fusion" neither at AspectJ nor PostSharp, and Dynamic Proxy by it's definition could not provide this kind of functionality also. See details here: http://programmers.stackexchange.com/a/181873/49383