So I have multiple classes that inherit from a main class (lets call it job, part, and task, that inherit from main).
We also have a Serialize class that does XML Serialization of an object, and another class that communicates to a 3rd party software (Epicor) that reads the XML generated and inserts that data into it.
Now we were tagging each class with / [Serializable] and each of the ReadOnly fields/Private Set fields that weren't required with / [NonSerialized]. This removed the errors we were getting for a type not having a public setter.
Trying to follow a DRY principle, I moved the code that was calling the serialize function to the main, which we inherit from. Now all I call is CreateXML(Me) to serialize an object. I removed the and tags from each of the classes, and low and behold...
It works. Unnaturally so, in my opinion. I'm asking this question to find a reason why this would work. The object has been rebuilt with the new classes, everything as far as I know has been cleared and rebuilt so that it's using the latest of everything we're building.
Why would it not care now that the class is not tagged as Serializable? There is nothing else in the main class that all the other objects inherit from, either. Clarification would be great if anybody would know.
No comments:
Post a Comment