A cache of group

  Abstract: A group of cache 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width = "100%" border = "0" cellspacing = "0" cellpadding = " 0 "> <tr> <td width="205" height="86" align="center" valign="top"> </ td> <td width="479" valign="top"> 

  Cache as an effective means to improve performance can be said to be everywhere.    CPU with a cache, L2 cache, database has its own data cache memory is, in fact, hard disk cache.    .    .    .    .    .    In the cache and procedures can effectively reduce the storage devices to interact with the application to increase capacity. 

  I passed in the actual design their own projects and the use of cache, and gradually improve the system of concurrent capacity, but also felt a lot of shortcomings: 

  1. System because it is based on the original optimization, cache the treatment does not have a unified planning, but piecemeal, piecemeal.    System cache scattered in the various modules, it's difficult to remember what used cache module 

  2. Cache the realization of a wide range, and some single cases, and some static objects, and object cache is the interaction with the database directly hard-coded in the original system, difficult to maintain 

  3. Cache parameters such as refresh interval.    .    .    .    .    .    No use of configuration files, but directly in the definition of the types of documents in the cache, configuration changes on the need to update the entire category, thereby affecting the operation of system 

  4. Lack of cache control mechanism and log mechanism, it is difficult to track problems and solutions. 

  After a period of specific projects baptism of java also have further understanding, I can also have the ability to solve the cache has been troubling the minds of these problems.    Idea is very simple, is that a single configuration file, all of the system in the management of a unified cache, cache all of the modules, and cache configuration parameters can clear.    And the configuration files override function is the question I have to consider that some of the cache configuration changes can be no effect on other cache, and these changes can also do not affect the running of circumstances.    Since it is a unified management course, it is necessary to achieve the unification of interfaces.    My definition of the Cache and CachePersistence two interfaces, and different cache can provide different realization of the need to achieve specified in the configuration file, and the realization of the default system to meet the simple application.    Had to begin to do so, and I also wanted to make a start like OSCache JbossCache or as a common cache, perhaps through constant exchanges, and constantly improve the final can be achieved.    After a simple design, I started to write code, I am a person, he could be called XP programming, huh!    Cache configuration parameters, I think under the project experienced a few, might also have, but I do not know, we need more project applications to discover, I can see the concrete included in the cache.xml document, on the allocation of specific instructions. 

  Development from the beginning of the final finished testing, it less than a week's time (to work spare time and overtime write), which also carried out several reconstruction.    Overall, fairly satisfied, I also count the first open-source projects ah, huh! 

  </ Td> </ tr> </ table> 

  Specifically, how to use, very simple, you are interested Cache interface can be achieved, I HashMap based on the built-in Cache, should be able to meet most application needs.    CachePersistence is your object storage devices and the realization of interactive, and you need to realize this general interface, and then deployed in the configuration file.    Then CacheFactory be Cache, Cache interface through the use of objects.    Cache on the operation you can use as a Map, from containers to automatic processing and storage equipment when the interaction, as long as you configured on the ok.    In addition to the reference src test kits, there are my Cache functional testing code, but also serve as examples of the use of the cache. 

  Having said that, if we are interested, I can download all the documentation, including the jar inside, src, lib, javadoc still configuration file, click here http://www.blogjava.net/Files/pesome/pcache.zip .    We also welcome in the actual project I use my cache, if there are any problems can be associated with me, mailto: pesome@163.com.    Thank you! 

  </ Td> </ tr> <tr> 

  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags:

Releated Java Articles

Comments

Leave a Reply