Which is better to store data as attributes or as elements? , JAVA Programming

 

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element.

1. Using  an  element:  Lord  of  the  Ring...:  If  you  consider  the  information  in question to be part of the essential material that is being communicated or expressed in the XML, put it in an element

2. Using an attribute: : If you consider the information to be incidental or peripheral  to  the  main  interaction,  or  purely  intended  to  help  applications  process  the  main interaction, use attributes.

The principle is data goes in components and metadata goes in attributes.  Elements are also useful when they occupy special characters like "<", ">", etc which are harder to accept in attributes. The most important reason to use component is its extensibility. It is far simpler to build child elements to reflect complex content than to split an attribute into pieces. You may use attributes along with components to refine your understanding of that element with extra information.

 

Posted Date: 7/27/2012 4:46:39 AM | Location : United States







Related Discussions:- Which is better to store data as attributes or as elements? , Assignment Help, Ask Question on Which is better to store data as attributes or as elements? , Get Answer, Expert's Help, Which is better to store data as attributes or as elements? Discussions

Write discussion on Which is better to store data as attributes or as elements?
Your posts are moderated
Related Questions
Design pattern : As you may look from the diagram given below, containers collect components. Sometimes you want to accumulate a container to another container. So, a container co

A Java package is a naming context for classes and interfaces. A package is used to make a separate name space for groups of classes and interfaces. Packages are also used to arran

Explain multi dimentional arrays in java? So far all these arrays have been one-dimensional. That is, a single number could locate any value in the array. Therefore sometimes d

Too many function invocations between the server and the client will lead to network overhead, tight coupling due to dependencies between the server and the client, misuse of serve



Develop a Graphical Display Framework Project Description: The intent of this project is to prepare a web based graphical display framework that will display many data points

I want Android App Notes Project Description: Seeking a developer to create a simple note application I don't need all the visualize features. I just want the user to t

Project Description: A java application is required with the subsequent features 1. Ability to use GSM Modem (and/or Mobile phones) or SMPP to send and receive SMS messages

Develop a code for fibonacci series