This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Suppose I have a class A with set of fields and method that makes em non-serializable:
And class B that extends class A and has static initializer that calls A.makePropertiesTransient :
Now comes the question When I create new instance of B method call makePropertiesTransient(B.class) is executed so all inherited fields in B become transient. But I found that for superclass (i.e. class A) they are also become transient so serialization process for instance of class A skips all fields too.
Could you suggest how to avoid propagation of transient properties to superclass, so instances of class A would be serialized completely, but instances of class B not ?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Making class fields non serializable using PropertyDescriptor