Deal of the Day

Home » Main » Manning Forums » 2012 » AOP in .NET

Thread: Loop fusion examples

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 4 - Pages: 1 - Last Post: Jan 8, 2013 4:58 AM by: akim.boyko Threads: [ Previous | Next ]
akim.boyko

Posts: 5
Registered: 1/2/13
Loop fusion examples
Posted: Jan 2, 2013 10:08 AM
  Click to reply to this thread Reply

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


Posts: 44
From: United States
Registered: 12/7/12
Re: Loop fusion examples
Posted: Jan 2, 2013 2:30 PM   in response to: akim.boyko in response to: akim.boyko
  Click to reply to this thread Reply

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

Posts: 5
Registered: 1/2/13
Re: Loop fusion examples
Posted: Jan 2, 2013 3:44 PM   in response to: matthew.groves in response to: matthew.groves
  Click to reply to this thread Reply

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


Posts: 44
From: United States
Registered: 12/7/12
Re: Loop fusion examples
Posted: Jan 2, 2013 3:54 PM   in response to: akim.boyko in response to: akim.boyko
  Click to reply to this thread Reply

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

Posts: 5
Registered: 1/2/13
Re: Loop fusion examples
Posted: Jan 8, 2013 4:58 AM   in response to: akim.boyko in response to: akim.boyko
  Click to reply to this thread Reply

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

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor