jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hanson Char <HC...@realm.com>
Subject RE: Why a cached object must be Serializable
Date Wed, 28 May 2003 05:19:53 GMT
Interesting idea but Cloneable won't work as Cloneable only suggests
"shallow copy" (like the Object.clone() behavior) which is insufficient to
provide thread safety if there are composite modifiable parts in the cached
item.

Serializable is better.

Hanson

-----Original Message-----
From: Heinz Drews [mailto:heinz@drews.tc]
Sent: Tuesday, May 27, 2003 8:59 AM
To: Turbine JCS Users List
Subject: Re: Why a cached object must be Serializable


Hanson,

I can only repeat my opinion that it is not the job of a cache
implementation to make an object
thread-safe, it is the job of the application to put only thread-safe
objects into the cache or
ensure single-thread processing.

I still support the change of the signature from Object to Serializable
because the implementation
enforces Serializable.

If your proposal of cloning would be in any form beneficial then you should
have proposed that
the signature should be Cloneable and not Serializable.
But as I said before, cloning does not solve the problem of wrong designed
or implemented objects in
the cache, just opposite it introduces problems with the possibility of
losing changes.
It also significantly complicates the implementation of a cache using
Soft/Weak references.

Best regards,
Heinz



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message