3 Replies Latest reply on Feb 27, 2009 7:23 AM by vinayknl.61

    Using DataType Object as a Key to JBoss Cache

    vinayknl.61

      Hi,

      I am creating a caching layer for my application. What I am planning to do is use a method arguments wrapped as an object, implement hashCode and equals for it and use this object as a key to the data i am going to store in the cache.

      What I am not sure is that does having this type of object as a key to a cache entry affects the performance of the cache ?

      Example Code :

      // pseudocode
      class MyParamWrapper
      {
       String arg1;
       int arg2;
       boolean arg3;
       ....
      
       // Implemented hashCode and equals ....
      }
      
      
      


      Using instance of above object as key to store return values.

      Thanks in advance for any help and advice