Analysis Datatypes Implementation Considerations
We've documented some common considerations when creating an implementation model or database design from an analysis model that uses these analysis datatypes.
Analysis Datatypes Implementation Considerations
Analysis Datatype Name | Compound Datatype | Implementation Considerations | Sample |
indicator | no | Make absolutely clear the meaning of the two values in this context. | hazardousmaterial.indicator 0 indicates material is not hazardous; 1 indicates material is hazardous |
code | no | While sometimes you might be able to get away with just a set of code values (e.g. M and F for gender codes), more frequently you'll need to maintain the set of codes in their own reference table. Typical attributes in that table include the code value, it's name, sort order, status, effective date. I recommend Malcolm Chisholm's book "Managing Reference Data in Enterprise Databases" as an excellent comprehensive resource on this topic. | Person.address-statecode |
datetime | no | Consider if you need to deal with multiple time zones. If so, including the offset from Greenwich Mean Time (GMT) is one way to handle that. | |
date | no | Consider if you need to deal with partial dates (e.g. January 2009). | |
time | no | Consider if you need to deal with multiple time zones. If so, including the offset from Greenwich Mean Time (GMT) is one way to handle that. | |
money | maybe | Either use (and document!) a single fixed currency (converting from others to that single currency if necessary), or include the currency code as a separate attribute (if so, consider utilizing the ISO 4217 currency codes as the domain). See the Implementation Consideration for the code datatype if you need to include currency code. | |
amount | maybe | Either use (and document!) a single unit of measure (converting from others to that single unit of measure if necessary) or include the unit of measure code as a separate attribute. See the Implementation Consideration for the code datatype if you need to include units code. | Item.height-cm |
quantity | no | Make clear what the count is of. | Meeting.attendee-count |
sequence number | no | Document whether or not the sequence number can change. | |
(postal) address | yes | Typically broken down into at least street address, city, state/province, zip/postal code, country. Consider if you need to accommodate foreign addresses. State/province should typically be constrained with a code table, as should country. Consider utilizing one of the sets of ISO country codes as the domain. Determine the level of generality for zip/postal code depending on the need to handle addresses in foreign countries. | |
phone number | typically no | Consider if country code is needed, either as part of the phone number or as a separate attribute. Consider if area code should be a separate attribute. Consider if foreign phone numbers need to be supported. | |
email address | typically no | e-mail addresses are defined in IETF RFC 5322 as ASCII strings that may have as many as 64 characters before the @ sign and a 255 character domain name after the @. Consider if the portion before and after the @ sign should be stored as separate attributes. | |
internet address | typically no | | |
identifier | no | Document the scope of the identifier and whether the attribute will always be valued. | |
name-person | yes | Typically broken down into separate attributes for first name, middle name, last name, suffix, and possibly prefix. | Person.name-prefix, Person.name-firstname, Person.name-middlename, Person.name-last, Person.name-suffix |
name-organization | no | | |
name-other | no | | |
specification text | no | | |
text | no | | |
encoded data | no | Document the particular types of data and/or file types allowed. | Person.photo-jpg |
ratio | maybe | Either use (and document!) a single unit of measure (if need be converting from others to that single unit of measure) or include the unit of measure code as a separate attribute or as two separate attributes. See the Implementation Consideration for the code datatype if you need to include the unit of measure code. | Vehicle.maximum-speed-mph. |
When not utilizing a separate attribute for currency code, amount code, etc., consider including an abbreviation for the particular units code as part of the column name. For example, purchase.amount-euro, person.height-cm, travel-reimbursement.distance-miles.
Acknowledgements
Thanks to the following people for their contributions: