O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Reflection to Serialize Types

One of the most prominent uses for reflection is serialization. Serialization is the process of turning an object into a stream of bytes that can be stored or transferred “elsewhere” and then used to reconstruct the object. You obviously cannot take an existing object and directly transfer it to another machine and expect it to work. Certain addresses and handles only correspond to memory on one machine or, for that matter, one process. In the past, MFC had a facility whereby an object could serialize and deserialize itself. The programmer decided which fields needed to be serialized through the code. Using reflection, it was possible to assist the programmer in serializing an object. The programmer no longer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required