iLingo - The Language of Insurance e-Business
(C) 1999 Lexica, LLC
3.2.2. Attributes vs. Elements
The decision of when to use attributes over elements is based on
the following criteria.
When to use attributes:
- When there is a single fact about an element and that fact has
no sub-structure.
- When it is necessary to link one element to some other element
or document.
- When the set of facts has no order.
When to use elements:
- When the fact is a component of the parent element with
sub-structure.
- When attributes or links are needed to be associated with the
fact.
- When there is a set of facts (e.g. a set of driver
violations).
- When order matters.
In addition, as an overall rule, if something has been made an
attribute or element for a particular reason, anything with a strong
relationship should be made to be similar. For example, in an Address, City and
Zip are elements, so State is an element as well.