[
Lists Home |
Date Index |
Thread Index
]
- To: "Tolkin, Steve" <Steve.Tolkin@fmr.com>
- Subject: RE: [xml-dev] specific element vs. generic element with a type attribute
- From: "Bullard, Claude L \(Len\)" <len.bullard@intergraph.com>
- Date: Mon, 13 Mar 2006 09:01:53 -0600
- Cc: <xml-dev@lists.xml.org>
- Thread-index: AcZGrGfCKs+3YIbKTe6CjD54A9IzXQAAETMw
- Thread-topic: [xml-dev] specific element vs. generic element with a type attribute
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@gmail.com]
On 3/12/06, Tolkin, Steve <Steve.Tolkin@fmr.com> 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.
|