This is .NET interview questions asked not to often. You should be prepared for everything because you may never know what is going in interviewer’s mind. So following is the answer we have penned in simple words.
Using binary serialization as compared to XML serialization: -
- Binary is smaller in size, so faster to send across network and also faster to process.
- XML is more verbose, but easy to understand and human readable. But due to the XMLstructure its complex to parse and can impact performance.
Scenarios where we can use serialization: -
Below are some scenarios where serialization is needed:-
- Passing .NET objects across network. For example .NET remoting , web services or WCF services use serialization internally.
- Copy paste .NET objects on clip board.
- Saving old state of the object and reverting back when needed. For example when the user hits the cancel button you would like to revert back to the previous state.