Physical Data Models
A Physical Data Model visually represents the structure of data as implemented by a relational database schema. In addition to providing a visual abstraction of the database structure, an important benefit of defining a Physical Data Model is that you can automatically derive the database schema from the model. This is possible due to the richness of metadata captured by a Physical Data Model and its close mapping to aspects of the database schema, such as database Tables, columns, Primary Keys and Foreign Keys.
Example Data Model
This example shows a Physical Data Model that could be used to automatically generate a database schema. Each Table is represented by a UML Class; Table columns, Primary Keys and Foreign Keys are modeled using UML attributes and operations. This model demonstrates the use of the Information Engineering connector style.
The example model is defined using Enterprise Architect's UML Profile for Data Modeling; the relationship between the Tables uses the default Information Engineering notation.
Information Engineering is one of three notations that Enterprise Architect supports to help Data Modelers identify cardinality in relationships. You can change the notation by selecting the 'Design > Diagram > Manage > Properties' ribbon option, clicking on the 'Connectors' page and selecting the required option in the 'Connector Notation' drop-down list. You would most probably change the notation to IDEFX1, but the UML2.1 notation is also available.
Prior to creating a Physical Data Model it is advisable for you to set the default DBMS for the project. Setting a default DBMS ensures that all new database elements that are created on diagrams are automatically assigned the default DBMS.
If the default DBMS is not set, new Tables are created without a DBMS assigned, this restricts Enterprise Architect's ability to model the physical objects correctly. For example Enterprise Architect is unable to determine the correct list of datatypes for columns.
You can set the default DBMS type using:
- 'Start > Desktop > Preferences > Preferences > Source Code Engineering > Code Editors', or
- 'Configure > Reference data > Settings > Database Datatypes or
- 'Develop > Data Modeling > Data Types or
- The second data entry field in the Code Generation Toolbar
Note: When modeling via the Database Builder the default DBMS is defined at the model level (as a Tagged Value 'DBMS' against the <<Database>> Package) instead of at the project level, thereby allowing for greater flexibility when projects involve multiple DBMSs.