Hi,
As per your sample code, Sample class will be serialized as a whole.
AFAIK, I think so that its not possible what you are going to do with built-in mechanizm and i am also wondering that any custom framework can do such thing...
You can remove some of things from your class when you serialize it so those items will be not serialized but if you make your interface object variable serializable then if the object is assigned to it then it will be serialized for sure.
Correct me if I am in wrong direction,
HTH,
|