Frequent Use of Type Codes
Frequent use of type codes is a sign of complex data. Relational DBMSs do not handle types well. As a result, identification and processing of type codes must be done in program code when using an RDBMS.
The figure at the left shows a "productType" field in a relational table that is used to differentiate processing for various types of products. Different type codes, for example, could identify types of sweaters and slacks in a clothing database.
To compare, in an ODBMS, types are an inherent part of the class hierarchy as shown in the figure below. In fact, the code for each type can be attached to the appropriate classes in the class hierarchy. In an ODBMS, the type codes are replaced with a class hierarchy with the method code attached. More on processing type codes.
More detail for the current topic: Frequent Use of Type Codes
More on the general topic: Complex Data
- Lack of Unique Identification
- Many-to-Many Relationships
- Access Using Traversals
- XML File for the Complex Data Example