.NET interview questions: - In which scenarios we can use serialization and when to use what binary serialization or XML 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.
- 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.
Also see following .NET interview questions videos debug directive in C#: -