[
Lists Home |
Date Index |
Thread Index
]
- From: "Mike Sharp" <msharp@lante.com>
- To: Bob DeRemer <Bob.Deremer@wonderware.com>
- Date: Fri, 23 Jun 2000 12:58:29 -0700
At one point in time, I favored the approach you're suggesting (columns as
attributes), because it seemed easier to code against, and you naturally think
of columns as attributes of a table (thinking in terms of a relational
database). Now, however, I prefer a more object oriented method, which doesn't
try to represent a relational database structure, but rather represents the
actual structure of the data itself, which isn't usually rectangular. This
abstracts the database schema, and it seems much more natural to think of, say,
a Person object (which might involve any number of table joins) rather than an
Employees table, joined with a lookup table to a Company Division table etc....
The former approach requires the user of the data to understand the database
schema, which isn't always clear in a complex system. An object oriented schema
is much easier to follow, in my opinion.
I use attribute in tags to describe the data the element tag represents. For
example, if an element is read-only, I would have something like:
<Person>
<EmployeeID RO="TRUE">1234567</EmployeeID>
<Name>John Galt</Name>
</Person>
That said, there is no "right" or "wrong" way, and XML doesn't require you to
represent data in a tree format at all. Others on this list have their own
ways, which work for them.
Regards,
Mike Sharp
"Why is lemon juice made with artificial flavor, and dishwashing liquid made
with real lemons?" --KPIG
Bob DeRemer <Bob.Deremer@wonderware.com> on 06/23/2000 04:41:44 AM
To: xml-dev@xml.org
cc: (bcc: Mike Sharp/Lante)
Subject: XML Schema generation questions [was SQL schema to XML schema...]
The one interesting aspect is whether the columns should be Attributes or
Elements. I've generated "BizTalk" compatible schemas for each type (i.e.
element-based and attribute-based). I'm not sure yet, which approach is
best.
Being fairly new to XML (i.e. 3 months), I'm curious if others have done
this before. If so, what they have learned along the way. My gut instinct
is to keep all columns as attributes, and each table is an element.
If anyone has any suggestions, they would be greatly appreciated.
Thanks again,
Bob
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
|