I've got a class Thing:
public abstract class Thing {
// prevent instantiation outside package. Indeed, no Things will
// ever actually have a runtime class of Thing
Thing(){};
public static Thing create() {
return new SpecialThing1();
}
public static Thing createSpecial() {
return new SpecialThing2();
}
}
final class SpecialThing1 extends Thing {/* etc etc */}
final class SpecialThing2 extends Thing {/* etc etc */}
Basically I want the objects the client ends up using to be Serializable, and the client to know that they will be Serializable. So which class(es) needs to implement Serializable? And which need the serialVersionUIDs?