[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: specific element vs. generic element with a type attribute

  • To: "Tolkin, Steve" <Steve.Tolkin@f...>
  • Subject: RE: specific element vs. generic element with a type attribute
  • From: "Bullard, Claude L \(Len\)" <len.bullard@i...>
  • Date: Mon, 13 Mar 2006 09:01:53 -0600
  • Cc: <xml-dev@l...>
  • Thread-index: AcZGrGfCKs+3YIbKTe6CjD54A9IzXQAAETMw
  • Thread-topic: specific element vs. generic element with a type attribute

programming type
Peter's right:  no free semantic lunch but the contexts 
of use present, past or future are informative.

I think of it in terms of viewpoints, or, from the 
perspective of the user or program, what am I looking 
for.  Realizing that one can search either way and 
always transform, how much work is it for the next 
user of the results? 

I ask myself if the next user/program needs a bag of 
"tools" or a bag of "hammers".

Otherwise, as Michael points out, classes bifurcate 
based on some frequency of occurrence of attributes. 
If one is at 100% for a given time/location/user 
viewpoint, that is probably the GI for that viewpoint.
For a single element, that's ok but if more are being 
added (ball pin hammer, claw hammer, etc.), then 
once again, you have a new dimension.  This is the 
important distinction:  how do you plan to manage 
extensibility? Do you control that?

Because there can be multiple viewpoints over the 
same information, tables are typically generic given 
the usual normalization/denormalization caveats for 
size and performance.   XML doesn't have to work 
that way depending on the persistence and viewpoints.

A toolbox with only one user can be neat or messy 
depending on the user's tastes.  A toolbox used 
by a family can be neat or messy depending on how 
much grumbling and who uses it most.  A toolbox 
used in a factory should be orderly and every tool 
in it's own location by type at the beginning of every shift 
particularly in cases where common tools are loaded 
into personal bags.

len


From: Peter Hunsberger [mailto:peter.hunsberger@g...]

On 3/12/06, Tolkin, Steve <Steve.Tolkin@f...> wrote:
> Which is better: using a set of specific elements or a generic element
> with a type attribute?

I can't add much to the advice you've already got except to note that
sometimes traditional data modelling can help make such decisions. 
For example, if you have an object model where orangeFee and yellowFee
are treated differently then that tells you something.  Similarly, if
you've got a database schema that has separate tables then that also
tells you something.  In such cases, using the specific elements may
make more sense.

Having said that, there are times you might want specific elements
even when neither of these conditions is true.  In such cases name
spaces can help partition off generic classes of elements that are
individually names.

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.