﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Alex Simkin commented on AOP: Be aware where your point cuts are</title><description>Thank you! I am making presentation on TDD, not -against- TDD :)
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment13</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment13</guid><pubDate>Thu, 20 Dec 2007 16:41:39 GMT</pubDate></item><item><title>Ayende Rahien commented on AOP: Be aware where your point cuts are</title><description>Alex,
  
Yes. But this is something that _was_ caught.
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment12</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment12</guid><pubDate>Thu, 20 Dec 2007 15:48:34 GMT</pubDate></item><item><title>Alex Simkin commented on AOP: Be aware where your point cuts are</title><description>What a beautiful example of how refactoring can break your code!
  
It doesn't matter how tight is your TDD "safety net" is, if you swim in murky waters of AOP and other "auto-magical" technologies you finaly revert to the ye olde debugger...
  
  
Could I please have your permission to use your post in my presentation on TDD?
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment11</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment11</guid><pubDate>Thu, 20 Dec 2007 14:14:57 GMT</pubDate></item><item><title>Mats Helander commented on AOP: Be aware where your point cuts are</title><description>Agreeing with Fabian ^ 
  
  
Also,
  
  
"BTW, that's an issue that would have probably been detected by an AOP-aware compiler - after all, a pointcut that doesn't select any join points is almost always a mistake."
  
  
Indeed, but even a Visualisation tool of any kind, showing how aspects are applied to targets according to the defined pointcuts, would have saved the day. 
  
  
In my opinion, subclass proxies are preferrable to interface based ones for just this reason (calls from a target instance to its own methods will not go via the proxy and so go unintercepted). To me, that means interface based proxy generation is very nearly broken. 
  
  
/Mats
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment10</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment10</guid><pubDate>Thu, 20 Dec 2007 10:28:07 GMT</pubDate></item><item><title>Fabian Schmied commented on AOP: Be aware where your point cuts are</title><description>Not to be nitpicking, but you're actually talking about "join points", not "pointcuts". A join point is where your aspects (potentially) interfere with the application. A pointcut, on the other hand, is a (usually declarative) selection of a subset of the possible join points.
  
  
In your example, all virtual methods on LoginController are potential join points (due to the way Windsor intercepts the methods on LoginController via the subclass proxy), whereas the methods on UsageRegistrationImpl do not constitute join points (because there is no interception going on for this class).
  
  
The [Transaction] attribute would probably constitute a pointcut specification. In your first implementation, the pointcut selected the LoginController.CreateUserLoggedInAuditRecord method. In the second implementation, it selected nothing.
  
  
So - be aware of where your _join points_ are when formulating pointcuts.
  
  
BTW, that's an issue that would have probably been detected by an AOP-aware compiler - after all, a pointcut that doesn't select any join points is almost always a mistake.
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment9</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment9</guid><pubDate>Thu, 20 Dec 2007 09:26:06 GMT</pubDate></item><item><title>Matt commented on AOP: Be aware where your point cuts are</title><description>Being completely off topic.... but what program do you use to make your diagrams? I know the first one looks like it was made in the Visual Studio class browser, but what about the last two?
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment8</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment8</guid><pubDate>Thu, 20 Dec 2007 03:23:33 GMT</pubDate></item><item><title>Ayende Rahien commented on AOP: Be aware where your point cuts are</title><description>Fancious,
  
No, I don't think there are hybrids, it is certainly possible, but not something that the ATM supports at the moment.
  
  
There are several solutions for this, manual transaction management, put [Transaction] on the register, use With.Transaction, etc
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment7</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment7</guid><pubDate>Wed, 19 Dec 2007 20:59:06 GMT</pubDate></item><item><title>Francois Tanguay commented on AOP: Be aware where your point cuts are</title><description>So the solution was?
  
  
Is there a way to have hybrid interception where both virtual and interface based strategies are used?
  
  
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment6</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment6</guid><pubDate>Wed, 19 Dec 2007 20:56:49 GMT</pubDate></item><item><title>Ayende Rahien commented on AOP: Be aware where your point cuts are</title><description>Jacques,
  
This is really something that depend on what you are doing. Yet, it is possible that calling save this way will cause just this issue, if you are using interface proxies for pointcuts
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment5</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment5</guid><pubDate>Wed, 19 Dec 2007 20:01:35 GMT</pubDate></item><item><title>Ayende Rahien commented on AOP: Be aware where your point cuts are</title><description>Andrey,
  
No, this is generic AOP problem, it means that you need to be aware of where your pointcuts are when you rely on their implementation.
  
  
Yes, *Impl is a good idea, at times.
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment4</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment4</guid><pubDate>Wed, 19 Dec 2007 19:59:18 GMT</pubDate></item><item><title>Jacques Philip commented on AOP: Be aware where your point cuts are</title><description>I had a problem maybe related:
  
  
public virtual bool Save()
  
{
  
  return Save(false);
  
}
  
  
[Transaction]
  
public virtual bool Save(bool skipValidation)
  
{
  
  Code for saving...
  
}
  
  
When I called Save(), the transaction did not happen and the record was not saved even though the Saving code executed in the second overload that had a Transaction attribute.
  
  
I needed to have a Transaction attribute on the first one too...
  
I figured it out, but without having the full understanding of why.
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment3</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment3</guid><pubDate>Wed, 19 Dec 2007 19:48:58 GMT</pubDate></item><item><title>Andrey Shchekin commented on AOP: Be aware where your point cuts are</title><description>I do not know AOP well enough, so, am I right when I see it as a container/proxy problem that does not exist when AOP is in language/platform itself?
  
  
And a nitpicking question: do you think that *Impl is a good name?
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment2</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment2</guid><pubDate>Wed, 19 Dec 2007 19:24:03 GMT</pubDate></item><item><title>Andrey Shchekin commented on AOP: Be aware where your point cuts are</title><description>I do not know AOP well enough, so, am I right when I see it as a container/proxy problem that does not exist when AOP is in language/platform itself?
  
  
And a nitpicking question: do you think that *Impl is a good name?
</description><link>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment1</link><guid>http://ayende.com/3059/aop-be-aware-where-your-point-cuts-are#comment1</guid><pubDate>Wed, 19 Dec 2007 19:24:03 GMT</pubDate></item></channel></rss>