We had some success on Monday creating some simple text files. Today we are going to review what we learned on Monday, then look at another way of reading and writing text files to the hard drive: Serialization.
Serialization is the process of taking objects in memory and turning them into a set of bytes, which can then be written to the hard drive or sent across a stream over the internet.
Deserialization is the reverse process, taking a stream of bytes and turning them back into their original objects.
Virtually every web application you have used or will ever use takes advantage of serialization.
Today I will do a simple demonstration, showing how you can add properties to a class definition and use the XmlSerializer class to serialize and deserialize the object, and show what the objects look like when they’re in transition.
Here is the updated SimpleNotepad app we did in class: