commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lavandowska <flanandow...@yahoo.com>
Subject Re: [commons-cache] Use of Serializable in Cache interface
Date Sat, 10 Jul 2004 03:36:26 GMT
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 <Kris.Nuttycombe@noaa.gov> 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
> Kris.Nuttycombe@noaa.gov
> 
> 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: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message