- From: Volker Zink <Volker.Zink@porabo.ch>
- Date: Mon, 23 Aug 2004 15:56:17 +0200
- To: Michael Kay <mhk@mhk.me.uk>
- CC: xmlschema-dev@w3.org
- Message-ID: <4129F781.5000007@porabo.ch>
Michael Kay schrieb: >>My experience is, the >>design should be as small and easy to understand as possible >>to achieve this goal. >> >> > >My experience is that a design with few restrictions (that is, maximum >orthogonality) is usually much smaller and easier to understand than a >design with many restrictions. > > As far as a language is concerned you may be right (i really don't have the experience here). For applications i would say that maximum orthogonality does produce more complexity (in the sense as i understand orthogonality: two things/aspects are orthogonal to each other, if they have nothing to do with each other/do not disturb each other). But as far as the by myself mentioned question is concerned, its not a matter of orthogonality but of granularity (elements and types are not independent and therefore not orthogonal). In programming languages classes are in namespaces (see below). in XML schemas IMHO this should be types. >>IMHO the namespace design in XML is too powerful and therefore too >>complex. This means too hard to understand, too many errors >>when using >>it, too hard to implement. Namespaces are nothing new. Why are the >>namespaces in XML more powerful as their counterparts in the >>programming >>languages? There must be more than 'why not'. >> >> > >Namespaces in XML are certainly a pain in the neck, few people nowadays >dispute that. But I don't think you can equate them to the way namespaces >are used in programming languages, because the naming architecture of XML is >completely different (for example, there is no concept of information >hiding). But I don't see where you are getting your analogies from. There is >no restriction in Java, for example, that the type of a method must be >related in any way to the name of the method. Method names and types in Java >are completely orthogonal, and it seems entirely reasonable that element >names and types in XML should also be orthogonal. > >Michael Kay > > > As far as i know Java, a namespace contains classes as a whole, not single methods or instance variables. As soon, as the class is defined in the namespace, its methods are in this namespace too. You cannot define one method to be in another namespace as the class. So the granularity is that of a class. So in programming languages you have a rather high granularity, but in XML schema you have a low granularity (as low as attributes). You say thats because of the different naming architecture of XML. I am just a simple user of XML schema and do not know the other XML technologies, so maybe i am completely wrong, but naming has to do with which entities has to be accessed and how. I access entities by (unique) names or other mechanisms (namespaces are a kind of hierarchical names). In programming languages classes are named, and the class knows its methods, instances variables, ... . So only the class has to be accessed in a global and unique way and therefore the namespace contains the class, the rest of naming is local to the class. In my eyes this is the same in XML schemas because element names and attribute names are not global too (there can be differnt elements with the name 'number' within a schema). The types know their elements and attributes and do access them local. So i don't see the difference in the naming architecture you mentioned. Volker Zink
Received on Monday, 23 August 2004 13:58:09 UTC