Results 1 to 4 of 4

Thread: strategies for caching persistent data

  1. #1
    Join Date
    Oct 2004
    Posts
    4

    Default strategies for caching persistent data

    hi all,
    i've read both of rod's books and have a question about caching strategies. in rod's first book (with ejbs) he developed a sample ticketing application that (from memory) used a very basic cache to access pricing & availability information (for performances @ the venue). this cache was maintained in the business layer. in the second book (without ejbs) the concept of caching at the data access layer was discussed using products such as hibernate and ehcache etc. this seems very attractive but gives rise to my question.
    my question is where does caching 'logic' belong? should it always be in the data access layer or are there times when it is permissable to use caching 'logic' in the business layer (as in rod's first book).
    what form of caching strategy would work best for the sample ticketing application (in 'with ejb's)?
    ur feedback would be most enlightning - implementing caching in an application is very new to me.

    news

  2. #2
    Join Date
    Sep 2004
    Location
    Melbourne, Australia
    Posts
    54

    Default

    Are you taking advantage of an ORM solution (e.g. Hibernate)?

    In applications I've written in the past, I have placed the caching logic in the business layer, it seemed like a good place to control the expiration of items in the cache. If I were doing the same today I would use AOP to place some advice around the data access layer to return the data from cache if it were appropriate.

  3. #3
    Join Date
    Oct 2004
    Posts
    4

    Default aop advice

    thanks for the reply dan. that sounds like good advice (no bad pun intended) - i was thinking of using an aop approach - to implement a cache you just need a way to look up the necessary data (appropriate data structure) and a 'timer' field to indicate when the data goes 'stale' - is that all?

  4. #4
    Join Date
    Jan 2005
    Posts
    3

    Default Re: strategies for caching persistent data

    In general ORM frameworks do a very good job for in this area, specialy Hibernate and iBatis.
    If you are using Spring JDBC layer or have a lot of data manipulation at the service layer, I'd recomend Wangy http://sourceforge.net/projects/wanghy] for caching method results.

Similar Threads

  1. Persistent Job using Quartz and Spring
    By MmarcoM in forum Container
    Replies: 8
    Last Post: Dec 16th, 2008, 03:57 AM
  2. Persistent Data Objects and Data Binding
    By Karsten Schmid in forum Architecture
    Replies: 0
    Last Post: Oct 19th, 2005, 04:56 AM
  3. Multiple Data Sources + Hibernate + Spring
    By joeserel in forum Data
    Replies: 2
    Last Post: May 18th, 2005, 09:22 AM
  4. Replies: 3
    Last Post: Apr 21st, 2005, 03:19 PM
  5. injecting complex configuration data
    By fox9 in forum Container
    Replies: 2
    Last Post: Feb 25th, 2005, 07:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •