• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Object Caching?

 
Ranch Hand
Posts: 31
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does the line "Object is stored in cache" mean? Can we control caching of objects?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means an instance of an object has been put into some persistent store. This could be, at the simplest level, something as basic as a Collection.

Consider this class:

This just wraps a Collection as a singleton (so we know there is only one instance of the cache in a program that uses it). In this case the object has been cached "in memory".

There are a multitude of cache implementations for different scenarios (for more complex situations have a google for JCS, EHCache, JBossCache JCache etc. ). All are configurable. A typical cache will have methods to specify how long an object can live in a cache before it becomes stale, what to do once the cache becomes full, how to uniquely identify objects in the cache, how often to check the cache for stale objects and so on. They may also include levels of caching, perhaps an in meneory cache with a File based cache that older objects are moved to once the in memory cache becomes full.
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic