Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Question about design

Reply
Thread Tools

Question about design

 
 
razael1@gmail.com
Guest
Posts: n/a
 
      11-01-2006
Let's say, for example, that I want to represent universities in XML.
Each university has any number of buildings, departments, and offices.
Which of these is better?

Option A:
<university>
<building>
<name>...</name>
</building>
...(include all buildings)
<department>
...(do the same for departments and offices)
</university>

Option B:
<university>
<buildings>
<building>
...
</buildings>
<departments>
<department>
...
</departments>
etc.
</university>

Are putting the different types of objects in their own groups
redundant, or does it make things clearer/more organized?

Thanks,
Colin K.

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      11-01-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Are putting the different types of objects in their own groups
> redundant, or does it make things clearer/more organized?


As with any other programming data-structure design issue, this is as
much a matter of style as anything else. If you were designing these as
structures/objects in your favorite programming language, which
organization would you prefer? The answer probably depends on which
operations you're going to be doing most often. Approach the XML design
the same way.

Generally, there's no harm in having an extra level of hierarchy in your
data structures.

However, I would suggest using attributes for values which describe a
datum rather than being contained within it. Specifically, I would prefer
<building name="...">
rather than making name an element, unless the name is itself a
structured datum.


--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
class design/ design pattern question Bartholomew Simpson C++ 2 06-12-2007 08:51 PM
Class design/design pattern resources TomTom MCSD 2 10-09-2004 07:38 AM
OO design in servlet design question dave Java 5 07-17-2004 12:58 PM
Xilinx Schematic design vs VHDL code design ZackS VHDL 5 07-09-2004 07:51 AM
Looking for help/resources on Writing a nice detailed design / tech design for vb.net code SpamProof Java 3 12-01-2003 06:06 AM



Advertisments