So I'm continuing my Java framework conversion. In Java, I had used the Serializable interface to mark my base Domain Object class as serializable. I also had an Id property on DomainObject that was type Serializable.

The bright folks at Microsoft, probably sneering at the idea of using an empty interface to mark a class serializable, decided to use that fancy new .NET concept of attributes. So to make my class Serializable, I add a [Serializable] attribute to it. Trouble is, attributes are not inherited, so I can no longer make a specific base class serializable, I have to remember to add [Serializable] to every class. And, to make things more exciting, if any class in the inheritence hierarchy does not have the [Serializable] attribute, you will not be able to serialize the class.

You can implement an ISerializable interface, but then you are in charge of doing all the serialization work in your class. Plus, it doesn't make any classes that inherit from it serializable either.

For extra credit, anyone know why this class won't serialize:
\n[Serializable]\npublic class ObjectNotFoundException : Exception\n{\n   public ObjectNotFoundException() {}\n}\n