December 18, 2002

XML Oriented Programming

In a posting about X# (XSharp), James Strachan makes the comment:

I can't help thinking that real programming languages should just provide their own APIs to XML and web services - is there really such a need for a new programming language just for XML? After all XML is just a text encoding format. [James Strachan - new programming language called X#? ]

Well, if you really want to see one of the reasons why there may be "a need for a new programming language just for XML", try mapping the "derivation by restriction" concept in XML Schema into any of the current object oriented programming languages. The concept is straight forward for humans to understand, but hard to model in OOP - it involves dealing with a more constrained interface which cannot be directly substituted for the original base interface in an OOP inheritance hierarchy. SUB-typing in the true sense of the word.

There are a whole range of functionality in XML Schema that simply does not map cleanly and directly into the traditional OOP world.

Another good example would be substitution groups - two or more entities that can substitute for one another, but which do not have a direct inheritence/extension relationship between them. Sure, suitable OOP inheritence and subtype relationships can be deduced and manufactured for this situation, but it can get very contrived at times, quickly hitting problems of multiple inheritance if we are not careful, and overall the whole situation loses a lot of the simple expressiveness of the original XML Schema version.

There are lots of other ideas and languages floating around in the area of XML Oriented Programming too, including MN8 and Jelly which were mentioned in a previous posting.

It will be interesting where the concepts and ideas around X#, MN8, Jelly and others will take us to, but I am sure it will be an interesting learning process for us all.

Maybe we need to coin a new phrase here - "XOP" - XML Oriented Programming

Entry categories: Programming XML
Posted by Jorgen Thelin at December 18, 2002 02:22 PM - [PermaLink]