Versioning: Namespaces or Attributes

Don mentioned my being a namespace versioning fan.  I admit it, I am.

I will also mention that I am not one of the web servae who think that the looser you are coupled, the better--but that is a discussion for another time.

As for the attribute approach being more beneficial because you can do something like:

if (dom.Attributes["version"] < latestVersion) ...

so add an [XmlIgnore] version property to the class that you deserialize into.

I definitely do not like the idea of having version info in two different places in the XML (because even with the attribute approach, the namespace still controls a level of versioning).  So even if you are on a platform that doesn't serialize/deserialize xml into objects for you, you will still have to check the namespace, then check the attribute to determine your version.

Comments (2)

  1. If you simply see XML Web Services as the next iteration of DCOM/CORBA/RMI then your position makes sense. It makes some of the comments you made at TechEd a bit clearer.

Skip to main content