[
Lists Home |
Date Index |
Thread Index
]
- From: Ronald Bourret <rpbourret@rpbourret.com>
- To: xml-dev@lists.xml.org
- Date: Thu, 19 Oct 2000 09:34:09 -0700
Jon Cleaver wrote:
>
> There appears to be a convergence of thought that the design of an XML
> schema is somewhat analogous to the creation of an Object Oriented Design
> for a piece of code. There are instances where you want to maximise
> component reuse and instances where you want data to be private. There are
> also instances where you want to combine both of these.
While I do see the similarities, there also seems to be one big
difference. In OO design, you can hide data inside an object and tell
everybody else that they can't see it. In XML, the data is in full view,
even if the element type definitions are local. All of which makes me
wonder why XML Schemas defined local element types in the first place.
Except for namespace hiding (which I hadn't thought of), the only
application I could see was a direct mapping of Java classes to XML
Schemas -- local element types would solve the problem of two different
classes having properties of the same name without having to resort to
per-class namespaces.
(As an aside, this is, IMHO, exactly why namespaces turned out to be so
hard. In programming languages, you have many levels of "local", and a
compiler can decorate names to ensure global uniqueness. All very nice
and hidden from a programmer. In XML, everything is in full view and the
schema author has to do the decoration manually.)
--
Ronald Bourret
Programming, Writing, and Training
XML, Databases, and Schemas
http://www.rpbourret.com
|