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

Re: Re: 3 possible approaches for representing concepts


attribute based approach

Joe:

Definately not number 1.  I have seen approach #1 when organizations
want to XMLize their EDI.  It is ugly and it is a programmers nightmare 
dealing with the long elements names.  It is much better to break it down 
into logical attributes.  I think you you want 2 or 3.  How about a #4 

<EstimatedAmount yearType="CurrentYear" amountType="Budget"
         finalIndicator="Final">  

I think you could make the case the <EstimatedAmount> and
<Amount> should be distinctive.  Also if there are default
attributes, the values wouldn't necessarily be required.

I still think the discussion of elements and attributes
from Robin Covers is good reading!

Betty


On Wed, 2 Apr 2003, Chiusano Joseph wrote:

> Clarification: There was some stray text at the end, here are the 3
> approaches:
> 
> APPROACH #1: Element-based approach
> 
> - One long-named element that represents the entire "concept":
> 
> <CurrentYearBudgetFinalEstimatedAmount>999.99</CurrentYearBudgetFinalEstimatedAmount>
> 
> APPROACH #2: Attribute-based approach
> 
> - One short- and simply-named element that represents the most basic
> concept, with multiple attributes to "fill in the meaning":
> 
> <Amount yearType="CurrentYear" amountType="Budget"
> finalIndicator="Final" estimateIndicator="Estimated">999.99</Amount>
> 
> APPROACH #3: Combined approach
> 
> - One more "fully-named" element with several attributes to "fill in the
> meaning":
> 
> <FinalEstimatedAmount yearType="CurrentYear" amountType="Budget">
> 999.99</FinalEstimatedAmount>
> 
> Thanks!
> Joe
> Joseph Chiusano wrote:
> > 
> > I would like to please solicit some quick feedback if possible regarding
> > an approach to using elements and/or attributes to represent concepts in
> > an XML document. I am having a "healthy debate" with a "colleague" on
> > how much "meaning" should be placed into an element name, and how much
> > (if any) should be "filled out" by attributes.
> > 
> > Below I've identified 3 approaches for representing a concept called
> > (pipes separate the "subconcepts"):
> > 
> > CurrentYear|Budget|Final|Estimated|Amount
> > 
> > A "related" element in the same XML document might be called (note only
> > the first subconcept has been changed):
> > 
> > PriorYear|Budget|Final|Estimated|Amount
> > 
> > I am interested in feedback regarding which of the 3 approaches below
> > folks have used (whether it was an XML schema or DTD), and also which
> > may be best for both constructing an XML document based on database
> > contents, and parsing an XML document and committing the contents to a
> > database. I am aware of all the "issues" surrounding use of attributes
> > (order not enforced, cannot have duplicate names, namespace handling,
> > etc.), so my inquiry is outside of those. My personal experience tells
> > me that approach #2 (attribute-based approach) is not best practice, and
> > there *may* be some issues with tools.
> > 
> > And here they are:
> > 
> > APPROACH #1: Element-based approach
> > 
> > - One long-named element that represents the entire "concept":
> > 
> > <CurrentYearBudgetFinalEstimatedAmount>999.99</CurrentYearBudgetFinalEstimatedAmount>
> > 
> > APPROACH #2: Attribute-based approach
> > 
> > - One short- and simply-named element that represents the most basic
> > concept, with multiple attributes to "fill in the meaning":
> > 
> > <Amount yearType="CurrentYear" amountType="Budget"
> > finalIndicator="Final" estimateIndicator="Estimated">999.99</Amount>
> > 
> > APPROACH #3: Combined approach
> > 
> > - One more "fully-named" element with several attributes to "fill in the
> > meaning":
> > 
> > <FinalEstimatedAmount yearType="CurrentYear" amountType="Budget">
> > 999.99</FinalEstimatedAmount>
> > 
> > <CurrentYearBudgetFinalEstimatedAmount
> > core:amountTypeID="Federal">999</core:EstimatedUnobligatedAmount>
> > 
> > Thanks in advance for your feedback.
> > 
> > Joe Chiusano
> > Booz | Allen | Hamilton

-- 



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.