EVALUATION
Strictly speaking we don't "need" custom support for serializing enum types:
the compiler could simply emit an appropriate readObject method. This
approach, however, has several disadvantages: (1) It would place a fair
amount of unnecessary code in the class files. (2) The details will have to
be spelled out to ensure consistency among compilers. (3) The resulting
serialized form would be inefficient in space and time; it would contain a
meaningless serial version UID and would construct and discard a "garbage
object" each time an enum constant was deserialized. Therefore, it seems
reasonable to add "first class" serialization support for enum types, as was
done for strings and arrays.
###@###.### 2003-03-31
|