Java provides java.io.Serializable
and java.lang.Cloneable
in his standard library (and special support for it in the language and the JVM) for tasks around deserializing/serializing/cloning.
Has C# chosen a different path to provide this functionality, how does the implementation and code using it differ from Java and why was it done this way?
As an example, why does C# use both an attribute (annotation) and an interface for serialization?
ISerializable
(marker), or[DataContract]
and[Serializable]
(attributes), etc. All cases require that the serializer knows how to "read" that kind of class/object but fundamentally it's not that much different. – Conductivity