I have a class A
implementing Serializable
and another class B extends A
, but I want to use class B
for XML binding, not for serialization.
Is there anything I should worry about?
I have a class A
implementing Serializable
and another class B extends A
, but I want to use class B
for XML binding, not for serialization.
Is there anything I should worry about?
Assuming you've implemented all of the Serializable
methods in A
, nope. You won't need to worry about implementing them, since that's already done. If there are any naming conflicts between XML binding and serialization, you can define the method in B
and your XML binding library will call the methods for B
, not those of A
(i.e. polymorphism).
The only potential worry is a method that takes an argument of type Serializable
-- if B
, for whatever reason, shouldn't be (de)serialized, this is a problem. I doubt that this is a problem for you, if only because there are so few cases when it would apply.