> Lew wrote:
>>> Furthermore, serialization imposes an additional public interface on
[quoted text clipped - 8 lines]
>
> That is neither true nor relevant.
Not true ? What public methods does Serializable have ? (I need to
update my Java Docs !)
> Serialization of a class makes the
> private members of that class, whatever they may be, accessible through
> the serialization / deserialization mechanism itself.
I see your point.
I don't consider that "circumvents the usual protections of
accessibility" because it is not really a public/private issue.
Persisting object to disk via serialization is usually a bad idea
because of the risk of incompatible changes to the class. Public
or private does not matter.
XML serialization is better because worst the XML files can be
edited (manually or programmatic).
Arne
Lew - 26 Mar 2008 04:07 GMT
>>> Serializable does not have any methods, so there are no "private"
>>> anything that becomes accessible.
Lew wrote:
>> That is neither true nor relevant.
> Not true ? What public methods does Serializable have ? (I need to
> update my Java Docs !)
The evaluation was for the conclusion, not for the premise. To be more
precise, I could have said, "That conclusion does not follow from the premise,
nor is it relevant." However, it seemed at the time more circumlocutory than
was needful.

Signature
Lew
Venkat Sadasivam - 26 Mar 2008 04:28 GMT
I don't agree with Roedy Green and Lew comments.
The complete serialization logic/code present in ObjectInputStream and
ObjectOutputStream. By including "implements Serializable" code
doesn't cause any performance overhead.
- Venkat
Lew - 26 Mar 2008 05:48 GMT
> I don't agree with Roedy Green and Lew comments.
>
> The complete serialization logic/code present in ObjectInputStream and
> ObjectOutputStream. By including "implements Serializable" code
> doesn't cause any performance overhead.
I never claimed a performance overhead, I claimed a maintenance overhead and a
security risk. These things are truth; it's inherent in the nature of
serialization. Agreement is moot.

Signature
Lew
Mike Schilling - 26 Mar 2008 04:35 GMT
> Persisting object to disk via serialization is usually a bad idea
> because of the risk of incompatible changes to the class. Public
> or private does not matter.
>
> XML serialization is better because worst the XML files can be
> edited (manually or programmatic).
Also because it gives the programmer more control over what's
persisted. You can design the bean properties of a serializeable
class to contain precisely what you want. And if need be, you can
completely re-implement the class while keeping the same set of
properties.
Lew - 26 Mar 2008 05:50 GMT
> Arne Vajh�j wrote:
>> Persisting object to disk via serialization is usually a bad idea
[quoted text clipped - 9 lines]
> completely re-implement the class while keeping the same set of
> properties.
These things are true of Serializable serialization as well.

Signature
Lew
Mike Schilling - 26 Mar 2008 07:31 GMT
>> Arne Vajh?j wrote:
>>> Persisting object to disk via serialization is usually a bad idea
[quoted text clipped - 11 lines]
>
> These things are true of Serializable serialization as well.
Much harder to accomplish there, though. The real problem is how
seductive it is to let all of the class's fields be serialized (with
perhaps a few obviously transient ones marked as such), and not
realize until you need to modify the class significantly just how
screwed you are.
Lew - 26 Mar 2008 13:38 GMT
> The real problem is how
> seductive it is to let all of the class's fields be serialized (with
> perhaps a few obviously transient ones marked as such), and not
> realize until you need to modify the class significantly just how
> screwed you are.
Yes! This is the danger of Serializable - it is a heavy responsibility. That
was my point in the first place.

Signature
Lew