Serializable

  • Thread starter Thread starter Patrick De Ridder
  • Start date Start date
P

Patrick De Ridder

Am I right in assuming that serialization is only used when creating a
sequentially written file?
 
No. Serialization is used whenever you want to preserve the state of an
object and/or transmit it across some type of boundary.

Writing the information to a file is one way to preserve the information and
you can definitely serialize for this reason. You might also want to
serialize and object before sending it across the internet such as a
webservice. Or you have out-of-process COM component (ServicedComponents)
which require that all passed information be serialized. Or, you can send
the data to a remote machine to be reconstructed and executed.

A recently project that I developed was a component that serialized an
object and encrypted it which was then saved to the registry.
 
Patrick,
In addition to Peter's comments.

Serialization is also useful to clone objects (implement the IClonable
interface). To support Cut & Paste and Drag & Drop. Also you can use
Serialization to store objects to a relational database as well.

The following 3 part MSDN Magazine column on Serialization, provides a
number of uses for serialization and how to implement them.
http://msdn.microsoft.com/msdnmag/issues/02/04/net/
http://msdn.microsoft.com/msdnmag/issues/02/07/net/
http://msdn.microsoft.com/msdnmag/issues/02/09/net/

Hope this helps
Jay
 
Back
Top