Serialization and De-serialization in inheritance hierarchy