c# - Why are interfaces not [Serializable]? -
i think adding attribute interface helpful make sure not create classes use interface , forget make them serializable.
this fundamental question, wanted ask experts.
interfaces define contract , not have state of own.
serialization saving , loading state , out of object model.
not point serializing holds no state.
to answer practical question of forcing implementation of interface serializable
- why iserializable
interface exists.
in .net can declare interface should implement other interfaces:
interface mustbeserializable : iserializable {}
see more information here.
Comments
Post a Comment