ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Memoization in Java Using Dynamic Proxy Classes
Subject:   Caching decision at run time
Date:   2003-08-21 04:40:33
From:   anonymous2
If your Memoizer.memoize method returned a transitional object (basically a morphing singleton) you could use the statistics at runtime to make that decision.


The transitional object would collect statistics and also serve "getMemo()" the memo object to the client (what you currently return from Memoizer.memoize).


Once enough runs of the calculation have been done, this method could decide to return the real object or continue returning the memo version, minus statistics collection.


This would only make sense for long running processes that use the memo object more than once. But it would also safeguard against making performance decisions for one platform, and finding out it is wrong for another.


Yuri.


1 to 1 of 1
  1. Tom White photo Caching decision at run time
    2003-08-22 00:17:43  Tom White | O'Reilly Author [View]

1 to 1 of 1