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:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
