[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 3 XML Design Principles
Alan, I dont think it follows that the structure of information in the XML representation needs to match the lexical representation. In the loose coupling demonstrated, the information is structured heirarchically, even though lexically it is not. To represent the same data you show, in a loosely coupled fashion, one would go : <organization id="org" /> <person id="john"> <worksFor /> </person> <person id="sue"> <worksFor="john" /> </person> <person id="stephan"> <worksFor="sue" /> </person> ....etc. This is pretty much the way the XML serialization of RDF works - the structure can be derived by an application / parser aware of the structure rules without depending on lexical structure. That being said, I would disagree with the original poster's assertion that flat structure is the preferred design. For things like XSL processing, a lexical structure that matches the information structure is desirable. For things like RDF, the lexical structure is not very important. So I think it is a matter of which technologies are being used. Regards, Kenneth On Sat, 29 Jan 2005 13:24:18 -0500, Alan Gutierrez <alan-xml-dev@e...> wrote: > * Roger L. Costello <costello@m...> [2005-01-29 12:20]: > > Hi Folks, > > > > Below I propose a few XML design principles. I am interested in hearing > > your thoughts on them, i.e., do you agree or disagree with them? > > > > Which is Better Design? > > > > Suppose that I have data about a grape vineyard. Below I show two lots on > > the vineyard, and a picker on one of the lots. I show two ways of designing > > the data. Which design is better? > > > > XML Design Principle #3 > > > Minimize the amount of nesting you use. > > > Nested data is tightly coupled and uses implicit relationships, both of > > which are bad. > > > Flat data is good data! > > > Flat data is loosely coupled and promotes the use of explicit relationships, > > both of which are good. > > Flat data is good data? > > How do you go about creating an org chart then? Imagine I've > gone an removed the person's name, address, and such... > > <organization> > <person id="john"> > <person id="sue"> > <person id="stephan"/> > </person> > <person id="shrinivas"> > <person id="daniel"/> > </person> > </person> > </organization> >
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|