160 likes | 290 Views
Database Design – Lecture 14. Converting an OO Data Model to a Class Diagram. Steps to Convert from an OODM to a Rose Model. Moving from the OODM to a Rose Class diagram is similar to creating a Relational Schema in Relational Database Design.
E N D
Database Design– Lecture 14 Converting an OO Data Model to a Class Diagram
Steps to Convert from an OODM to a Rose Model • Moving from the OODM to a Rose Class diagram is similar to creating a Relational Schema in Relational Database Design. • There should be minimal changes to make to the structure of the classes. • However, need to prepare for converting to a relational structure so there are some steps that need to be taken.
Steps to Convert from an OODM to a Rose Model • To start: • Make all attributes atomic. • Remove references to other classes (ADTs) from the class. In the class diagram, we will show the relationships via associations, aggregations and compositions. • Create new classes for multi-valued attributes. • Remove derived attributes.
Conversion Examples • Simple Object • Convert OODM class to a Rose class Visio class: Rational Rose class:
Conversion Examples • Composite Object • Convert OODM class to a Rose class • Multi-valued attribute becomes a Rose class Visio class: Rational Rose classes:
Conversion Examples • Compound Object • Convert OODM class to a Rose class • Create a Rose class for the object that is referenced Visio class: Rational Rose classes:
Conversion Examples • Hybrid Object • Convert OODM class to a Rose class • Create a Rose class for the object that is referenced (i.e. Education) and create another Rose class for the multi-valued attribute (i.e. dateEarned)
Conversion Examples Visio class: Rational Rose classes:
Steps to Convert from an OODM to a Rose Model • How to handle relationships • Assume relationship is denoted with an association initially. Further analysis may still determine aggregation/composition or inheritance (if not already done in the OODM). • Multiplicity is translated based on the multiplicity shown in the OODM. • Assume associations are bi-directional unless either logically obvious they are not or if application processing describes the direction.
Steps to Convert from an OODM to a Rose Model • Relationships: • Customer:Address is 1:1 (bi-directional)
Steps to Convert from an OODM to a Rose Model • Relationships: • Plan:Client is 1:M
Steps to Convert from an OODM to a Rose Model • Relationships: • Movie:Actor is 1:1 (uni-directional)
Steps to Convert from an OODM to a Rose Model • Relationships: • Employee:Beneficiary is M:N • Create an association or intersection class
Steps to Convert from an OODM to a Rose Model • Relationships: • Employee:Beneficiary is M:N • With an intersection class
Steps to Convert from an OODM to a Rose Model • Relationships: • Employee:Dependent is 1:M • Aggregation
Steps to Convert from an OODM to a Rose Model • Relationships: • Employee:Dependent is 1:M • Composition