Imagine, your Java Bean subclasses another bean, passing a type parameter; that other bean has a couple of setter/getter methods that take and return the values of the parameter type.
Now, you use your bean with some kind of library that does serialization based on introspection via reflection. What does it know about the superclass bean? That it takes and returns an object, right? So... so we lose! Serialization is okay, default is "toString()", but how about deserialization? Seems like we are clueless there. Shit.
I know the solution: override the setter. But this is stupid.
Now, you use your bean with some kind of library that does serialization based on introspection via reflection. What does it know about the superclass bean? That it takes and returns an object, right? So... so we lose! Serialization is okay, default is "toString()", but how about deserialization? Seems like we are clueless there. Shit.
I know the solution: override the setter. But this is stupid.