UML Data Modeling Profile - UML

While on the subject of RDBs, not surprisingly, the UML has become a popular notation for data models. Note that one of the official UP artifacts is the Data Model, which is part of the Design discipline. Figure illustrates some notation in the UML for data modeling.

Figure 37.2 UML Data Modeling Profile example

These stereotypes are not part of the core UML - they are an extension. To generalize, the UML has the concept of a UML profile: a coherent set of UML stereotypes, tagged values, and constraints for a particular purpose. Figure illustrates part of a proposed Data Modeling Profile.

Pattern: Object Identifier

It is desirable to have a consistent way to relate objects to records, and to be able to ensure that repeated materialization of a record does not result in duplicate objects.

The Object Identifier pattern [BW96] proposes assigning an object identifier (OID) to each record and object (or proxy of an object).

An OID is usually an alphanumeric value; each is unique to a specific object. There are various approaches to generating unique IDs for OIDs, ranging from unique to one database, to globally unique: database sequence generators, the High - Low key generation strategy [AmblerOO], and others.

Within object land, an OID is represented by an OID interface or class that encapsulates the actual value and its representation. In an RDB, it is usually stored as a fixed length character value.

Every table will have an OID as primary key, and each object will (directly or indirectly) also have an OID. If every object is associated with an OID, and every table has an OID primary key, every object can be uniquely mapped to some row in some table.

This is a simplified view of the design. In reality, the OID may not actually be placed in the persistent object - although that is possible. Instead, it may be placed in a Proxy object wrapping the persistent object. The design is influenced by the choice of language.

An OID also provides a consistent key type to use in the interface to the persistence service.

Figure 37.3 Object identifiers link objects and records

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

UML Topics