Women in Technology

Hear us Roar



Article:
  Memoization in Java Using Dynamic Proxy Classes
Subject:   AOP...
Date:   2003-08-21 11:01:29
From:   crazybob
I've successfully employed this same solution in the past. One suggestion, if you implement this using a dynamic proxy based AOP framework (Nanning for example), you have less code to maintain, and you can easily limit the caching to certain methods. You could limit it to methods following a certain naming convention (i.e., "get*"), or you could use XDoclet-like attributes and cache any method with an "@idempotent" attribute.
Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Tom White photo AOP...
    2003-08-22 00:14:15  Tom White | O'Reilly Author [View]

    Lots of interesting ideas here! It seems very natural to implement memoization as a part of a AOP framework, as you really get a lot of control over which methods to memoize. (Although if you are not using AOP, the approach presented in the article works just fine.) I will definitely check out Nanning.

    Thanks for your feedback.

    Tom