HTML5 Canvas
Written by: Simon Sarris
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Web Driver
  3. MVVM
  4. REST
  5. ADO.NET
  1. HTML5
  2. Ajax
  3. jQuery Selectors
  4. CSS Part 1
  5. Git

Link Details

Link 143951 thumbnail
User 111696 avatar

By bloid
via martin.ankerl.com
Published: Dec 24 2008 / 15:14

Imagine you have some Java code that does lots and lots of computation. All the time intensive calculations is performed by the class SlowCalculator which implements the interface Calculator:
  • 7
  • 3
  • 2252
  • 1

Comments

Add your comment
User 7165 avatar

Eugene Kuleshov replied ago:

0 votes Vote down Vote up Reply

Seem like an example how to not to do this. I recommend to read "Java concurrency in practice", there is an example how caching proxy code should look like.

User 202203 avatar

sunitram replied ago:

0 votes Vote down Vote up Reply

why not do it this way?

User 251826 avatar

stanasic replied ago:

0 votes Vote down Vote up Reply

Interesting, but dynamic proxying has been around for quite some time, since 1.3, so I would hardy call this amazing.

User 283958 avatar

jimwhite replied ago:

0 votes Vote down Vote up Reply

This is a widely known technique called memoization.

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

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

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (7)



Voters Against This Link (3)