[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
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! 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
|