jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hanson Char" <hanson_c...@yahoo.com>
Subject Why the caching API should use Serializable rather than Object
Date Sat, 22 May 2004 12:38:47 GMT
Quoted from Item 24 of Effective Java by Joshua Bloch:

"You must program defensively with the assumption that clients of your class
will do their best to destroy its invariants."

"...if you are considering using a client-provided object reference as an
element in an internal Set instance or as a key in an internal Map instance,
you should be aware that the invariants of the set or map would be destroyed
if the object were modified after it were inserted."

This principle/rule is generally violated in JCS for the use of Object in
the method signature.


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

View raw message