Serialization in .Net 3.5 SP1

In .Net 3.5 SP1 it is now possible to serialize any object that has a default constructor without decorating it with [DataContract] or [Serializable].

Developers have these choices now when serializing objects:

  • Implicit serialization – requires public default constructor and only serialize public read/write fields
  • Use the [Serializable] attribute
  • Use [DataContract] and [DataMember] attributes
  • Implement the ISerializable interface

I must say, that I’m not keen on this new feature. I prefer explicit serialization to implicit serialization. I predict that implicit serialization of entire object graphs will cause performance problems for many .Net developers in the years to come. This could also be a good thing as I am a consultant  ;-)

Aaron Skonnard has a more detailed blog post about the new serialization features in .Net 3.5 SP1.


 Anders Lybecker is an chief architect at Avior A/S, a consultancy firm in Copenhagen, Denmark. He holds a degree in software engineering specializing in software development. His primary expertise are the Microsoft .Net framework and SQL Server which he has been working with since the start of this century! He enjoys discussing technical topics, teaching and speaking at conferences.


Related posts:

  1. Handcrafting the WCF client
  2. WCF Throttling – Part 1
  3. .Net debugger visualizers
  4. A simple Windows Communication Foundation Web Service

Tags: ,

Leave a Reply