The Artima Developer Community
Sponsored Link

.NET Buzz Forum
PDC - Day 2 - WSV303 - Indigo, Using XSD, CLR Types and Serialization in Web Services

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Hanselman

Posts: 1031
Nickname: glucopilot
Registered: Aug, 2003

Scott Hanselman is the Chief Architect at Corillian Corporation and the Microsoft RD for Oregon.
PDC - Day 2 - WSV303 - Indigo, Using XSD, CLR Types and Serialization in Web Services Posted: Oct 29, 2003 2:05 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Scott Hanselman.
Original Post: PDC - Day 2 - WSV303 - Indigo, Using XSD, CLR Types and Serialization in Web Services
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Scott Hanselman
Latest Posts From Scott Hanselman's ComputerZen.com

Advertisement

I'm here sitting with Rory in the Xml Serialization talk being given by the legendary Doug Purdy.  Doug's quite a good speaker and very funny.

Lengendary? Why?  Well, not only is he responsible for the goodness that is the XmlSerializer, he's also responsible (or he knows the guy who is) for this undocumented switch:>

      <add name="XmlSerialization.Compilation" value="1" />

>>If you add this to a .config file (for your AppDomain) you'll get some temporary files in c:\documents and settings\local settings\ \temp.  Try it.  Run some serialization code and checkout the .CS file(s) that are created.  Very damn useful.  This works today with .NET.

But I'm here to hear about new versions of stuff.  Here's some new things about XmlSerialization in the Whidbey version of .NET.

  • There's a tool called SGEN that will “NGEN” your serialization code. That way you don't need to take the initial hit when the Serialization Assembly is emited.  You can basically ship it with the code.
  • Adding support for Generics to the Serializer, both open generics and instatiated generics
  • Support for Extensibility around Schema Importing
  • SqlType support
  • The BinaryFormatter is Version Tolerant
  • Here's some new Attributes:
    • [OptionalSerializable] - Does just what you'd think.  Makes a field optional, and consequently helps you deal with Version changes between Object Heirarchies

Here's what's going on with XmlSerialization in Indigo (after Whidbey, in Longhorn):

  • The Serializer is now in the Core
  • Architecture of the CLR, not just “tacked on“
  • A Tale of Two Type Systems
    • Act One: Whidbey
      • Mapping XSD into the CLR is very challenging, including mapping some of the concepts that exist in XSD that just don't in the CLR
      • Mapping from the CLR to XSD is fairly straightforward
      • CLR to CLR is really easy
    • Act Two: Indigo
      • Big Conclusion - Serialization is different than Xml Programming.  Developers don't think about the format on the wire.  They want the CLR to fix it for them.
      • New stack: XmlFormatteer consiting of Serialization Engine -> Extensibility -> Xml Processing - Representations
      • XmlBinaryReader and XmlBinaryWriter being introduced
      • Allow the developer to express the data contract for a given type Explicitly
      • [DataMember] lets you markup any member and include it into the Data Contract.  It doesn't care about accessiblity.  That means you can mark something private or internal and if it's marked with [DataMember] then it gets serialized.
      • Cool...you can have two totally “different“ CLR types, perhaps one has a private something with a property accessor and another version has the same “semantic“ member but it's public.  You can mark them up with DataMember to make the contract with the serializer the same so the objects will serialize the same.
      • WHY IS THIS IMPORTANT: You can serialize one CLR object from one Assembly and deserialize it into another totally different implemenation (a totally different CLR type).  As long as we both agree on the contract, we can use the same underlying data representation.  Yum.
  • Existing Types continue to work, but you get loose coupling and version resiliance

Doug said he woke up this morning hoping the sky would be Indigo.  It wasn't.  But one day...

P.S. I forgot to mention that Christian Weyer can lift Rory with ease.  If he were Austrian, he could be a governor.

Read: PDC - Day 2 - WSV303 - Indigo, Using XSD, CLR Types and Serialization in Web Services

Topic: Keynote - Photos Previous Topic   Next Topic Topic: My ClickOnce chapter is up on the web

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use