Doug Purdy's serialization talk started with full of enthusiasm. Lots of expectations were in the room, and Doug Purdy and the successor of XmlSerializer did not disappoint us. Since I am really tired and have to sleep, I post some keywords Doug showed us today.
- BinaryFormatter is now version-aware.
There will be new attribute temporarily called [OptionallySerializable] to tell BinaryFormatter that some previously serialized data does not have values for fields.
- The new XmlFormatter is really an InfoSetFormatter.
But Doug, InfoSet has [encoding] property... ;-)
- [DataContract], [DataMember] is the new way to tell we want to serialize some member fields of some objects.
- [OnDeserializing], [OnDeserialized], [OnSerializing], [OnSerialized]
Are those attributes indication that interfaces in OOP not applicable to the real world programming?
- SerializationContext.Current.KnownTypes.Add and "base type aware schema generation"
Serialization is really what they do to maintain those nature of type system.
- "wsdlgen.exe /server" now can process "every" and he means "every" XML Schema.
Anonymous types inside element declarations, no problem. I heard someone (I am sorry I forgot his name. He was introduced as a Dev. Lead in Doug's session. I have to thank him) that it even solves the problem called "choice of sequences". How those constructs are turned into C# code? Well, if it is supported to be [DataContract], it will. If it won't, then wsdlgen.exe will try to do it itself. If it can't, then we will get parameters typed Message, which is XmlReader.
- System.Serialization will not last.
Doug and his teammates' efforts on this namespace survived in the PDC bits, but will not likely in the Beta 1. He told us it solved 96%, but they throw them away. What a courage.
And for the last, but definitely not least, Doug taught us that Serialization is what we use to serialize and deserialize between CLR and stream. It is not another way to program against XML. For XML programming, we have plenty of staff in WinFx, like XmlReader and XPathNavigator. Those are not serialization. If you love XSD and can't live without substitution groups and choice of sequences, you will live with XML programming model in the WinFx. If you want serialization, you are concerned about CLR. They have [DataContract], [Serializable] and ISerializable for the purpose. Let's repeat: Serialization is for CLR, not XML programming.
Finally, Doug told us that if COM is love, Indigo IS love because every developer including asmx lover, EntrrpriseServices lover, and Remoting enthusiasts will love Indigo as the successor of their beloved technology. I am thinking on this topic, and will post my opinion later.
I really fell in love with Doug (don't worry Doug, I'm straight) this evening. He is my most favorite speaker so far.