<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Debunking myths: proxies impact performance</title>
	<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/</link>
	<description>The voice of SpringSource</description>
	<pubDate>Thu, 21 Aug 2008 01:39:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>

	<item>
		<title>by: Alef Arendsen</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-89437</link>
		<pubDate>Thu, 17 Jan 2008 22:35:55 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-89437</guid>
					<description>Hi Cliff,

this is exactly what I did. It was a very quick benchmark and this is the usual technique I use as well. I do usually execute these tests on a *nux-based machine, as I find the accuracy of system.currentTimeMillis() to be a little better there. As long as the you make the number of executions very big, it doesn't really make a difference anymore however...

One thing you have to keep in mind: micro benchmarks are not really useful if you *really* want to know about the performance of a specific operation. A micro benchmark ignores a lot of stuff such as concurrency, the difference in platforms you run the benchmark on, et cetera... So this is really only indicative.</description>
		<content:encoded><![CDATA[<p>Hi Cliff,</p>
<p>this is exactly what I did. It was a very quick benchmark and this is the usual technique I use as well. I do usually execute these tests on a *nux-based machine, as I find the accuracy of system.currentTimeMillis() to be a little better there. As long as the you make the number of executions very big, it doesn&#039;t really make a difference anymore however&#8230;</p>
<p>One thing you have to keep in mind: micro benchmarks are not really useful if you *really* want to know about the performance of a specific operation. A micro benchmark ignores a lot of stuff such as concurrency, the difference in platforms you run the benchmark on, et cetera&#8230; So this is really only indicative.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Cliff Meyers</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-89417</link>
		<pubDate>Thu, 17 Jan 2008 21:49:27 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-89417</guid>
					<description>Very interesting and useful article.  May I ask how you performed this benchmark?  Did you just loop over a method invocation a very large number of times, say several billion?  I have been doing some benchmarks on operations that take roughly 1 millisecond to execute and I find that using calls to System.currentTimeMillis() seem to only have a precision of 15-20ms.  I've compensated by running a very large number of tests, measuring the total and dividing to get an everage.  But if there is some other technique for getting more precise time measurements I would love to know about it!  Thanks.

-Cliff</description>
		<content:encoded><![CDATA[<p>Very interesting and useful article.  May I ask how you performed this benchmark?  Did you just loop over a method invocation a very large number of times, say several billion?  I have been doing some benchmarks on operations that take roughly 1 millisecond to execute and I find that using calls to System.currentTimeMillis() seem to only have a precision of 15-20ms.  I&#039;ve compensated by running a very large number of tests, measuring the total and dividing to get an everage.  But if there is some other technique for getting more precise time measurements I would love to know about it!  Thanks.</p>
<p>-Cliff
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: 59 23 * * 0 flush &#187; ×”×”×ª×—×œ×”</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-71998</link>
		<pubDate>Tue, 27 Nov 2007 08:58:47 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-71998</guid>
					<description>[...] ×‘× ×•×©×? ×?×—×¨ ×œ×’×ž×¨×™, ×?×œ×£ ×?×¨× ×“×¡×Ÿ ×ž×¦×•×•×ª ×”×›×•×ª×‘×™×? ×”×—×“×© ×©×œ ×¡×¤×¨×™× ×’(×–×” ×©× ×¨×?×” ×›×ž×• ×¡×™×§-×‘×•×™ ×ž×˜×¨×™×™× ×¡×¤×•×˜×™× ×’) ×ž×¡×¤×¨ ×œ× ×• ×‘×‘×œ×•×’×• ×”×ž×œ×‘×œ×‘ ×¢×œ ×ž×¢×©×™×™×ª ×”×¤×¨×•×§×¡×™ ×•×™×¨×™×“×ª ×”×‘×™×¦×•×¢×™×?. ×©×•×” ×œ×§×¨×•×?, ×•×œ×• ×¨×§ ×›×“×™ ×œ×§×‘×œ ×ž×•×©×’ ×œ×’×‘×™ ×¢×•×œ×ž×? ×”×§×¡×•×? ×©×œ ×”×¤×¨×•×§×¡×™×? ×‘×¡×¤×¨×™× ×’. ×™×© ×§×˜×¢ ×›×–×” ×©×œ ×”×—×‘×¨×™×? ×‘×¡×¤×¨×™× ×’ ×œ×”×’×Ÿ ×¢×œ ×”×¤×¨×•×§×¡×™×?, ×œ×”×’×™×“ ×©×‘×¢×¦×? ×”×›×œ ×™×—×¡×™, ×•×©×–×” ×œ×? × ×›×•×Ÿ ×œ×”×’×™×“ ×©×¤×¨×•×§×¡×™×? ×ž×’×“×™×œ×™×? ×‘×™×¦×•×¢×™×? ×¤×™ ×—×ž×©×ª ×?×œ×¤×™×?, ×œ×¢×¨×š(×‘×§×¨×•×‘: ×ž×¢×ž×“ ×©×œ ×ž×™×¢×•×˜ ×?×ª× ×™ ×‘×¢×¦×¨×ª ×”×?×•×ž×•×ª ×”×ž×?×•×—×“×•×ª). ×?×– × ×›×•×Ÿ ×©×”×¡×•×’×™×” ×?×™× ×” ×—×“ ×ž×©×ž×¢×™×ª, ×•×©×”Ö·×¤Ö°×¢Ö²×œ×•Ö¹×ª ×žÖ¶×¤Ö¼Ö°×¨×•Ö¼×§Ö°×¡Ö·×¡×•Ö¹×ª ×™×›×•×œ×•×ª ×œ×§×—×ª ×‘×?×•×¤×Ÿ ×™×—×¡×™ ×›×ž×¢×˜ ×?×•×ª×• ×–×ž×Ÿ(×›×Ÿ, ×›×Ÿ), ×?×‘×œ ×‘×›×œ ×–×?×ª, ×?×ª ×”×§×˜×¢ ×”×‘×? ×§×¨×?×• ×ª×—×ª ×?×–×”×¨×ª ×?×•×‘×™×™×§×˜×™×‘×™×•×ª, ×‘×ž×˜×•×˜×?. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] ×‘× ×•×©×? ×?×—×¨ ×œ×’×ž×¨×™, ×?×œ×£ ×?×¨× ×“×¡×Ÿ ×ž×¦×•×•×ª ×”×›×•×ª×‘×™×? ×”×—×“×© ×©×œ ×¡×¤×¨×™× ×’(×–×” ×©× ×¨×?×” ×›×ž×• ×¡×™×§-×‘×•×™ ×ž×˜×¨×™×™× ×¡×¤×•×˜×™× ×’) ×ž×¡×¤×¨ ×œ× ×• ×‘×‘×œ×•×’×• ×”×ž×œ×‘×œ×‘ ×¢×œ ×ž×¢×©×™×™×ª ×”×¤×¨×•×§×¡×™ ×•×™×¨×™×“×ª ×”×‘×™×¦×•×¢×™×?. ×©×•×” ×œ×§×¨×•×?, ×•×œ×• ×¨×§ ×›×“×™ ×œ×§×‘×œ ×ž×•×©×’ ×œ×’×‘×™ ×¢×•×œ×ž×? ×”×§×¡×•×? ×©×œ ×”×¤×¨×•×§×¡×™×? ×‘×¡×¤×¨×™× ×’. ×™×© ×§×˜×¢ ×›×–×” ×©×œ ×”×—×‘×¨×™×? ×‘×¡×¤×¨×™× ×’ ×œ×”×’×Ÿ ×¢×œ ×”×¤×¨×•×§×¡×™×?, ×œ×”×’×™×“ ×©×‘×¢×¦×? ×”×›×œ ×™×—×¡×™, ×•×©×–×” ×œ×? × ×›×•×Ÿ ×œ×”×’×™×“ ×©×¤×¨×•×§×¡×™×? ×ž×’×“×™×œ×™×? ×‘×™×¦×•×¢×™×? ×¤×™ ×—×ž×©×ª ×?×œ×¤×™×?, ×œ×¢×¨×š(×‘×§×¨×•×‘: ×ž×¢×ž×“ ×©×œ ×ž×™×¢×•×˜ ×?×ª× ×™ ×‘×¢×¦×¨×ª ×”×?×•×ž×•×ª ×”×ž×?×•×—×“×•×ª). ×?×– × ×›×•×Ÿ ×©×”×¡×•×’×™×” ×?×™× ×” ×—×“ ×ž×©×ž×¢×™×ª, ×•×©×”Ö·×¤Ö°×¢Ö²×œ×•Ö¹×ª ×žÖ¶×¤Ö¼Ö°×¨×•Ö¼×§Ö°×¡Ö·×¡×•Ö¹×ª ×™×›×•×œ×•×ª ×œ×§×—×ª ×‘×?×•×¤×Ÿ ×™×—×¡×™ ×›×ž×¢×˜ ×?×•×ª×• ×–×ž×Ÿ(×›×Ÿ, ×›×Ÿ), ×?×‘×œ ×‘×›×œ ×–×?×ª, ×?×ª ×”×§×˜×¢ ×”×‘×? ×§×¨×?×• ×ª×—×ª ×?×–×”×¨×ª ×?×•×‘×™×™×§×˜×™×‘×™×•×ª, ×‘×ž×˜×•×˜×?. [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: John "Z-Bo" Zabroski</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36696</link>
		<pubDate>Sat, 28 Jul 2007 14:46:49 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36696</guid>
					<description>Sorry.  I was confused by this statement: "When I have time I'll try to have a look at the small benchmark that I prepared."</description>
		<content:encoded><![CDATA[<p>Sorry.  I was confused by this statement: &#034;When I have time I&#039;ll try to have a look at the small benchmark that I prepared.&#034;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alef Arendsen</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36239</link>
		<pubDate>Thu, 26 Jul 2007 06:26:57 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36239</guid>
					<description>[quote comment="36230"]How do you intend on designing this benchmark?  Now _that_ would be something to blog about.  You might get good feedback on how to design or improve the quality of the benchmark, too.[/quote]
John,

I hope you realize that my goal of this blog entry was to actually point out that a I'm not going to do a benchmark :) as it is irrelevant. Of course, from a theoretic standpoint it would definitely be a nice exercise, but unfortunately I (and I think neither does any of my colleagues) don't have time for this...

regards,
Alef</description>
		<content:encoded><![CDATA[<p>On July 25, 2007 at 10:28 pm, John &#034;Z-Bo&#034; Zabroski said:</p>
<blockquote cite="http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36230"><p>
How do you intend on designing this benchmark?  Now _that_ would be something to blog about.  You might get good feedback on how to design or improve the quality of the benchmark, too.</p>
</blockquote>
<p>John,</p>
<p>I hope you realize that my goal of this blog entry was to actually point out that a I&#039;m not going to do a benchmark <img src='http://blog.springsource.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  as it is irrelevant. Of course, from a theoretic standpoint it would definitely be a nice exercise, but unfortunately I (and I think neither does any of my colleagues) don&#039;t have time for this&#8230;</p>
<p>regards,<br />
Alef
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: John "Z-Bo" Zabroski</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36230</link>
		<pubDate>Thu, 26 Jul 2007 03:28:42 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36230</guid>
					<description>How do you intend on designing this benchmark?  Now _that_ would be something to blog about.  You might get good feedback on how to design or improve the quality of the benchmark, too.</description>
		<content:encoded><![CDATA[<p>How do you intend on designing this benchmark?  Now _that_ would be something to blog about.  You might get good feedback on how to design or improve the quality of the benchmark, too.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alef Arendsen</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36057</link>
		<pubDate>Tue, 24 Jul 2007 14:28:50 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36057</guid>
					<description>[quote comment="36046"]
Thanks a lot for this great article.
[/quote]
Thanks Maz. I appreciate that.

[quote comment="36046"]
BTW, debuging Marcs code I was really surprised to discover that hibernate (assuming using cglib) will also create proxies for abstract classes and the AbstractMethodError is thrown later when you really call a method. Is it a bug or feature? (not a serious question :)
[/quote]
Hmm, interesting. I never noticed this behavior. Of course it's possible and technical totally understandable (yes, by default Hibernate uses CGLIB unless you specify otherwise), but I would argue that this is not the behavior that you'd expect as a user...

[quote comment="36046"]
1. A mediate C  -Compiler is capable to detect empty functions and eliminate them. In Java the at least hotspot compiler would do this by inlining the empty block, so no time should be consumed calling the empty function after a given number of calls.
Have you considered this in your micro benchmark? (So the function should count a counter or something like that to avoid compiler/hotspot optimization and counting the call time after the hotspot optimisation is in place?)
[/quote]
When I have time I'll try to have a look at the small benchmark that I prepared. Of course my whole point was that performance doesn't really matter ;-), but I understand that this can have a big impact. I'll probably have to update the article anyway after some other comments, so I'll try to incorporate that in a future revision.

[quote comment="36046"]
2. My Feeling is that obsessive usage of proxies will hinder compiler optimization as the compiler always will end up on interfaces and the link to the implementation is only available in the application-context.xml. And the usage of reflection is also not supporting the hotspot compiler.
Do you agree or are there any discussions covering this topic?
[/quote]
That's an interesting suggestion. I'm not about this, I wish I was a compiler expert but unfortunately, I'm not :). At first sight, I would agree. I've forwarded this to some other guys, let's see what they come up with.</description>
		<content:encoded><![CDATA[<p>On July 24, 2007 at 8:32 am, Maz Rashid said:</p>
<blockquote cite="http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36046">
<p>Thanks a lot for this great article.
</p>
</blockquote>
<p>Thanks Maz. I appreciate that.</p>
<p>On July 24, 2007 at 8:32 am, Maz Rashid said:</p>
<blockquote cite="http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36046">
<p>BTW, debuging Marcs code I was really surprised to discover that hibernate (assuming using cglib) will also create proxies for abstract classes and the AbstractMethodError is thrown later when you really call a method. Is it a bug or feature? (not a serious question <img src='http://blog.springsource.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
</blockquote>
<p>Hmm, interesting. I never noticed this behavior. Of course it&#039;s possible and technical totally understandable (yes, by default Hibernate uses CGLIB unless you specify otherwise), but I would argue that this is not the behavior that you&#039;d expect as a user&#8230;</p>
<p>On July 24, 2007 at 8:32 am, Maz Rashid said:</p>
<blockquote cite="http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36046">
<p>1. A mediate C  -Compiler is capable to detect empty functions and eliminate them. In Java the at least hotspot compiler would do this by inlining the empty block, so no time should be consumed calling the empty function after a given number of calls.<br />
Have you considered this in your micro benchmark? (So the function should count a counter or something like that to avoid compiler/hotspot optimization and counting the call time after the hotspot optimisation is in place?)
</p>
</blockquote>
<p>When I have time I&#039;ll try to have a look at the small benchmark that I prepared. Of course my whole point was that performance doesn&#039;t really matter <img src='http://blog.springsource.com/main/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> , but I understand that this can have a big impact. I&#039;ll probably have to update the article anyway after some other comments, so I&#039;ll try to incorporate that in a future revision.</p>
<p>On July 24, 2007 at 8:32 am, Maz Rashid said:</p>
<blockquote cite="http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36046">
<p>2. My Feeling is that obsessive usage of proxies will hinder compiler optimization as the compiler always will end up on interfaces and the link to the implementation is only available in the application-context.xml. And the usage of reflection is also not supporting the hotspot compiler.<br />
Do you agree or are there any discussions covering this topic?
</p>
</blockquote>
<p>That&#039;s an interesting suggestion. I&#039;m not about this, I wish I was a compiler expert but unfortunately, I&#039;m not <img src='http://blog.springsource.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . At first sight, I would agree. I&#039;ve forwarded this to some other guys, let&#039;s see what they come up with.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Maz Rashid</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36046</link>
		<pubDate>Tue, 24 Jul 2007 13:32:45 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36046</guid>
					<description>Dear Alef,

Thanks a lot for this great article.
I had this discussion recently with Marc and I think he missed the point.

First of all I love Spring at all and want to use this opportunity to thanks all you guys for this great work. I already have realized two big pan european projects with Spring and I am also aware of the based technology for the Spring factory framework.

The point was, that Marc just joined the team when our project was in the last days of the test phase and no big changes were expected to be done and commited buggy code  which broke the build.

I thought that I had made clear that the main issue was, that breaking the build just before delivering is not a good idea.
Beside that one of my last points was, that springifying that particular class would not make any sense as no of the mentioned advantages would apply and then you have only to pay the overhead.
That's it. Thanks for backing up my position.

BTW, debuging Marcs code I was really surprised to discover that hibernate (assuming using cglib) will also create proxies for abstract classes and the AbstractMethodError is thrown later when you really call a method. Is it a bug or feature? (not a serious question :)

But reading your article I have some particular questions helping me to see some issues more clearly:

1. A mediate C  -Compiler is capable to detect empty functions and eliminate them. In Java the at least hotspot compiler would do this by inlining the empty block, so no time should be consumed calling the empty function after a given number of calls.
Have you considered this in your micro benchmark? (So the function should count a counter or something like that to avoid compiler/hotspot optimization and counting the call time after the hotspot optimisation is in place?)

2. My Feeling is that obsessive usage of proxies will hinder compiler optimization as the compiler always will end up on interfaces and the link to the implementation is only available in the application-context.xml. And the usage of reflection is also not supporting the hotspot compiler.
Do you agree or are there any discussions covering this topic?


Great thanks in advance
Maz
http://www.mazcity.de</description>
		<content:encoded><![CDATA[<p>Dear Alef,</p>
<p>Thanks a lot for this great article.<br />
I had this discussion recently with Marc and I think he missed the point.</p>
<p>First of all I love Spring at all and want to use this opportunity to thanks all you guys for this great work. I already have realized two big pan european projects with Spring and I am also aware of the based technology for the Spring factory framework.</p>
<p>The point was, that Marc just joined the team when our project was in the last days of the test phase and no big changes were expected to be done and commited buggy code  which broke the build.</p>
<p>I thought that I had made clear that the main issue was, that breaking the build just before delivering is not a good idea.<br />
Beside that one of my last points was, that springifying that particular class would not make any sense as no of the mentioned advantages would apply and then you have only to pay the overhead.<br />
That&#039;s it. Thanks for backing up my position.</p>
<p>BTW, debuging Marcs code I was really surprised to discover that hibernate (assuming using cglib) will also create proxies for abstract classes and the AbstractMethodError is thrown later when you really call a method. Is it a bug or feature? (not a serious question <img src='http://blog.springsource.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But reading your article I have some particular questions helping me to see some issues more clearly:</p>
<p>1. A mediate C  -Compiler is capable to detect empty functions and eliminate them. In Java the at least hotspot compiler would do this by inlining the empty block, so no time should be consumed calling the empty function after a given number of calls.<br />
Have you considered this in your micro benchmark? (So the function should count a counter or something like that to avoid compiler/hotspot optimization and counting the call time after the hotspot optimisation is in place?)</p>
<p>2. My Feeling is that obsessive usage of proxies will hinder compiler optimization as the compiler always will end up on interfaces and the link to the implementation is only available in the application-context.xml. And the usage of reflection is also not supporting the hotspot compiler.<br />
Do you agree or are there any discussions covering this topic?</p>
<p>Great thanks in advance<br />
Maz<br />
<a href="http://www.mazcity.de" rel="nofollow">http://www.mazcity.de</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Stephan Oudmaijer</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36034</link>
		<pubDate>Tue, 24 Jul 2007 12:20:05 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36034</guid>
					<description>Nice article, we just had a discussion about it yesterday. We also looked at an AOP performance comparison that can be found here: http://docs.codehaus.org/display/AW/AOP Benchmark. Is this still a valid one?</description>
		<content:encoded><![CDATA[<p>Nice article, we just had a discussion about it yesterday. We also looked at an AOP performance comparison that can be found here: <a href="http://docs.codehaus.org/display/AW/AOP" rel="nofollow">http://docs.codehaus.org/display/AW/AOP</a> Benchmark. Is this still a valid one?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alef Arendsen</title>
		<link>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36026</link>
		<pubDate>Tue, 24 Jul 2007 11:43:55 +0000</pubDate>
		<guid>http://blog.springsource.com/main/2007/07/19/debunking-myths-proxies-impact-performance/#comment-36026</guid>
					<description>[quote comment=\"35973\"]I\'m inexperienced, so I apologize if my points seem sophomoric.  That said...

Does it make sense to compare dynamic proxies to bytecode weaving?  In other words, are you inadvertently talking past whether this is even a debate?  I do not know, so let us discuss it and perhaps agree on an answer.

Bytecode weaving just means that bytecode is weaved into the class file generated by the compiler.  AspectJ supports compile-time, post compile-time and load-time weaving.  Classes can be instrumented with extra behavior at any of these points and ajc even supports subsequent reweaving by default.

A proxy, on the other hand, is a surrogate object used to control access to the real object.

Are these two concepts mutually exclusive?  Although you did not directly state so, you did mention an 80/20 split between the proxy design technique and bytecode weaving technique.  You seem to have set forth an assumption that these concepts are mutually exclusive.

I\'m testing your assumption because it simply doesn\'t sound right to me, albeit I\'ve never been forced to think in these terms before, perhaps neither have you.  It sounds like you are thinking at the implementation level, in the language of Java, rather than thinking about the problem at a higher level.  What might be a good high level model of this problem?  In order to describe this problem, I think you need a modular system in place to control the routing of messages.  Modular is important, because it means you must be able to both add and take away from the message routing system.  In my humble opinion, this is exactly what aspect-oriented programming seeks to address.[/quote]

You\'ve nailed it! I think your last paragraph is possibly one of the better explanations of the difference between AOP and proxies (or least, the difference in the level of the two concepts).

So yes, on a conceptual (or higher) level, it does absolutely not make sense to compare the two, only on an implementation level and this is exactly what I was trying to achieve. I should probably make that a little bit more explicit. I think I have to rewrite some of this including a clearer distinction between the levels of abstraction we\'re talking about.

In other words: you\'re totally right :). And no, the two are definitely not mutually exclusive.</description>
		<content:encoded><![CDATA[<blockquote><p>
I\&#039;m inexperienced, so I apologize if my points seem sophomoric.  That said&#8230;</p>
<p>Does it make sense to compare dynamic proxies to bytecode weaving?  In other words, are you inadvertently talking past whether this is even a debate?  I do not know, so let us discuss it and perhaps agree on an answer.</p>
<p>Bytecode weaving just means that bytecode is weaved into the class file generated by the compiler.  AspectJ supports compile-time, post compile-time and load-time weaving.  Classes can be instrumented with extra behavior at any of these points and ajc even supports subsequent reweaving by default.</p>
<p>A proxy, on the other hand, is a surrogate object used to control access to the real object.</p>
<p>Are these two concepts mutually exclusive?  Although you did not directly state so, you did mention an 80/20 split between the proxy design technique and bytecode weaving technique.  You seem to have set forth an assumption that these concepts are mutually exclusive.</p>
<p>I\&#039;m testing your assumption because it simply doesn\&#039;t sound right to me, albeit I\&#039;ve never been forced to think in these terms before, perhaps neither have you.  It sounds like you are thinking at the implementation level, in the language of Java, rather than thinking about the problem at a higher level.  What might be a good high level model of this problem?  In order to describe this problem, I think you need a modular system in place to control the routing of messages.  Modular is important, because it means you must be able to both add and take away from the message routing system.  In my humble opinion, this is exactly what aspect-oriented programming seeks to address.</p>
</blockquote>
<p>You\&#039;ve nailed it! I think your last paragraph is possibly one of the better explanations of the difference between AOP and proxies (or least, the difference in the level of the two concepts).</p>
<p>So yes, on a conceptual (or higher) level, it does absolutely not make sense to compare the two, only on an implementation level and this is exactly what I was trying to achieve. I should probably make that a little bit more explicit. I think I have to rewrite some of this including a clearer distinction between the levels of abstraction we\&#039;re talking about.</p>
<p>In other words: you\&#039;re totally right <img src='http://blog.springsource.com/main/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . And no, the two are definitely not mutually exclusive.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
