Serializing interfaces

No. You can’t serialize an interface. Ever. It just told you that.

An interface is nothing more than a description of a set of behaviors. It says nothing about the contents of an instance. In particular, although an instance of a class implementing an interface must implement all of its members, it will certainly have properties of its own which need to be serialized.

How would it be deserialized?

What class would be used to deserialize the interface on the other side?

Leave a Comment