<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Amazing Caching Proxy in Java</title>
	<atom:link href="http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/</link>
	<description>Chunky bacon!!</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:00:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Amir</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-3611</link>
		<dc:creator>Amir</dc:creator>
		<pubDate>Fri, 16 Dec 2011 00:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-3611</guid>
		<description>Hey Martin,

I had been working on something similar. We initially had been using @Cacheable that uses Spring and AOP to do some caching via ehcache. But as I made a project open source, I didn&#039;t want to depend on Spring. So I started with some of your code but cleaned it up a lot. With the use of Guava, I was able to make the code a lot less. I also used Arrays.deepEqual() which works really well. If you want to check it out here it is

https://github.com/opower/jpile/blob/master/src/main/java/com/opower/persistence/jpile/reflection/CachedProxy.java</description>
		<content:encoded><![CDATA[<p>Hey Martin,</p>
<p>I had been working on something similar. We initially had been using @Cacheable that uses Spring and AOP to do some caching via ehcache. But as I made a project open source, I didn&#8217;t want to depend on Spring. So I started with some of your code but cleaned it up a lot. With the use of Guava, I was able to make the code a lot less. I also used Arrays.deepEqual() which works really well. If you want to check it out here it is</p>
<p><a href="https://github.com/opower/jpile/blob/master/src/main/java/com/opower/persistence/jpile/reflection/CachedProxy.java" rel="nofollow">https://github.com/opower/jpile/blob/master/src/main/java/com/opower/persistence/jpile/reflection/CachedProxy.java</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martinus</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-3610</link>
		<dc:creator>martinus</dc:creator>
		<pubDate>Thu, 15 Dec 2011 16:20:37 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-3610</guid>
		<description>Hi Amir! I am notified for each comment, so if you have something to add, please post so :)</description>
		<content:encoded><![CDATA[<p>Hi Amir! I am notified for each comment, so if you have something to add, please post so <img src="http://martin.ankerl.com/wp-includes/images/smilies/icon_smile.gif?9d7bd4" alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-3609</link>
		<dc:creator>Amir</dc:creator>
		<pubDate>Thu, 15 Dec 2011 16:05:39 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-3609</guid>
		<description>Martin, are you still active on this thread? If so I can point you to some modifications that I made to improve this caching logic.</description>
		<content:encoded><![CDATA[<p>Martin, are you still active on this thread? If so I can point you to some modifications that I made to improve this caching logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cheind</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-674</link>
		<dc:creator>cheind</dc:creator>
		<pubDate>Sat, 27 Dec 2008 10:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-674</guid>
		<description>hi martin &amp; merry christmas,

you might consider some features of the memcache library for ruby (i.e. expiration you&#039;ll need sooner or later). Here&#039;s an application quite the same as yours http://refactormycode.com/codes/609-caching-methods.

Joined github? Can anyone here my echooooooo? :)</description>
		<content:encoded><![CDATA[<p>hi martin &amp; merry christmas,</p>
<p>you might consider some features of the memcache library for ruby (i.e. expiration you&#8217;ll need sooner or later). Here&#8217;s an application quite the same as yours <a href="http://refactormycode.com/codes/609-caching-methods" rel="nofollow">http://refactormycode.com/codes/609-caching-methods</a>.</p>
<p>Joined github? Can anyone here my echooooooo? <img src="http://martin.ankerl.com/wp-includes/images/smilies/icon_smile.gif?9d7bd4" alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-673</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 25 Dec 2008 20:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-673</guid>
		<description>This is not thread safe (HashMap has to be synchronized).
That&#039;ll make it potentially much slower in a multi-threaded application. ConcurrentHashMap might help.

- Anon</description>
		<content:encoded><![CDATA[<p>This is not thread safe (HashMap has to be synchronized).<br />
That&#8217;ll make it potentially much slower in a multi-threaded application. ConcurrentHashMap might help.</p>
<p>- Anon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Ankerl</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-672</link>
		<dc:creator>Martin Ankerl</dc:creator>
		<pubDate>Thu, 25 Dec 2008 10:58:48 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-672</guid>
		<description>thanks for the link, Jim!</description>
		<content:encoded><![CDATA[<p>thanks for the link, Jim!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim White</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-671</link>
		<dc:creator>Jim White</dc:creator>
		<pubDate>Thu, 25 Dec 2008 05:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-671</guid>
		<description>This is already a widely known technique called memoization.

http://en.wikipedia.org/wiki/Memoization

Heh, just looked at the Java implementation link, and it is this same proxy method published five years ago.

http://www.onjava.com/pub/a/onjava/2003/08/20/memoization.html</description>
		<content:encoded><![CDATA[<p>This is already a widely known technique called memoization.</p>
<p><a href="http://en.wikipedia.org/wiki/Memoization" rel="nofollow">http://en.wikipedia.org/wiki/Memoization</a></p>
<p>Heh, just looked at the Java implementation link, and it is this same proxy method published five years ago.</p>
<p><a href="http://www.onjava.com/pub/a/onjava/2003/08/20/memoization.html" rel="nofollow">http://www.onjava.com/pub/a/onjava/2003/08/20/memoization.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fede</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-670</link>
		<dc:creator>fede</dc:creator>
		<pubDate>Wed, 24 Dec 2008 23:15:18 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-670</guid>
		<description>public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
             final Args input = new Args(method, args);
             Result result = argsToOutput.get(input);
             if (result==null) {
                  result= new Result(method.invoke(code, args));
                  argsToOutput.put(input, result);
             }
             return result.getValue();
         };</description>
		<content:encoded><![CDATA[<p>public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {<br />
             final Args input = new Args(method, args);<br />
             Result result = argsToOutput.get(input);<br />
             if (result==null) {<br />
                  result= new Result(method.invoke(code, args));<br />
                  argsToOutput.put(input, result);<br />
             }<br />
             return result.getValue();<br />
         };</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Ankerl</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-669</link>
		<dc:creator>Martin Ankerl</dc:creator>
		<pubDate>Wed, 24 Dec 2008 20:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-669</guid>
		<description>Hi ben, good points! I have never used referencemap before. And if it returns null it always recalculates. I could use containsKey but then I need two lookups, one for contains and one to get the element. Merry christmas!</description>
		<content:encoded><![CDATA[<p>Hi ben, good points! I have never used referencemap before. And if it returns null it always recalculates. I could use containsKey but then I need two lookups, one for contains and one to get the element. Merry christmas!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ben</title>
		<link>http://martin.ankerl.com/2008/12/22/amazing-caching-proxy-in-java/#comment-668</link>
		<dc:creator>ben</dc:creator>
		<pubDate>Wed, 24 Dec 2008 20:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://martin.ankerl.com/?p=184#comment-668</guid>
		<description>Improvements:

1. Use a referencemap
2. What happens if there is a large running process that returns null? :P

Merry xmas</description>
		<content:encoded><![CDATA[<p>Improvements:</p>
<p>1. Use a referencemap<br />
2. What happens if there is a large running process that returns null? <img src="http://martin.ankerl.com/wp-includes/images/smilies/icon_razz.gif?9d7bd4" alt=':P' class='wp-smiley' /> </p>
<p>Merry xmas</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 2/4 queries in 0.002 seconds using disk: basic
Object Caching 445/447 objects using disk: basic

Served from: martin.ankerl.com @ 2012-02-08 22:30:41 -->
