Kris,

You will find that most cache projects require the use of Serializable
objects.  Because the cache may store the items on disk, or transmit
them to another location (RMI for example) the items must be
Serializable.  Because the usage is configurable the interface must be
prepared for such an eventuality.

It isn't the Cache so much as the Store that makes this requirement. 
As you say, it could be up to the Store to reject non-Serializable
objects.

Commons-Cache is all but dead, you certainly could modify your own copy
and remove the Serializable requirement.

Lance

--- Kris Nuttycombe <[EMAIL PROTECTED]> wrote:
> Hi, all,
> 
> Can someone explain to me the rationale of requiring cached objects
> to 
> implement Serializable in the Cache interface? This has the potential
> to 
> make life significantly more difficult if all you want to do is use a
> 
> well-managed MemoryCache to store an instances of a class that would 
> require a complicated custom serialized form to implement
> Serializable 
> properly. Shouldn't this decision be left up to the individual Cache 
> implementations? Caches that need to serialize their objects can
> always 
> throw IllegalArgumentException if the value to be cached doesn't 
> implement Serializable without impacting a more generally useful
> Cache 
> interface.
> 
> Kris
> 
> -- 
> =====================================================
> Kris Nuttycombe
> Associate Scientist
> Geospatial Data Services Group
> CIRES, National Geophysical Data Center/NOAA
> (303) 497-6337
> [EMAIL PROTECTED]
> 
> Every problem has an elegant solution.
> If you cannot conceive of an elegant solution,
> you have not yet correctly understood the problem.
> =====================================================
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to