Database Answers Logo

Monument Fish, Hawaii, Click for large picture (80K)
Translating a UML Model to an Entity-Relationship Diagram

Some Background
The Relational model is very well-established.
Object databases, by comparison, are very immature and making progress very slowly.
One of the best features of Relational Databases is that they are supported by a very
well-known and proven underlying mathematical theory.
This is a simple set theory that has many benefits, including schema generation from high-level models.

The pure Object Databases will never reach these capabilities of Relational Databases.
The Object paradigm is already proven for application design and development, but it may
simply not be an adequate paradigm for the data store.

Hybrid Object-Relational databases will probably be the long term trend for the industry.

Translating a UML Model to an Entity-Relationship Diagram
A series of simple rules can be followed to translate an Entity-Relationshion Diagram,("ERD"), into a Database design.
Translating a UML Model into a Database design can follow similar rules, with some additional rules to account for
some of the expanded features of UML Models.
This table defines a suitable sequence of steps to translate a UML Model into an ERD :-

Nr. TASK
1 Every UML Class becomes a Table
2 Every UML Attribute in Class becomes a Column in a Table
3 Every UML Attribute Type becomes a Column Type using a Type Transformation Table
4 Every NULLable UML Attribute becomes a NULLable Column, otherwise NOT NULL constraint
5 If UML Attribute has Initializer, add DEFAULT value to Colum
6 For Classes with no generalization and implicit identity, create primary key
7 For Sub-Classes, add the key of each parent class to the Primary Key of the Table and to a
Foreign Key constraint
8 For Association Classes, add the primary key from each role-playing table to PRIMARY KEY
constraint and FOREIGN KEY constraint
9 Add FOREIGN KEYs for each 0..1, 1..1 for each Role in an Association
10 Create PRIMARY KEY for composite aggregations with FOREIGN KEY to
aggregating tables and add additional column for PRIMARY KEY
11 Create Tables for many-to-many associations with no association classes
12 Create PRIMARY KEY, FOREIGN KEY constraints from keys of role-playing tables in
many-to-many associations.


[ Home Page | Ask me a Question | SQL Scripts | Email | FAQs | Search & Site Map ]


© IceBreaker WebDesigns 2000