Title: Universal Modeling Language (UML) Class Diagrams Compared to EER
1EER vs. UML Terminology
EER Diagram Entity Type Entity Attribute Domain Co
mposite Attribute Derived Attribute Relationsh
ip Type Relationship Instance Cardinality
Participation
- UML Class Diagram
- Class
- Object
- Attribute
- Domain
- Structured Domain
- Operation
- Association
- Link
- Multiplicities
2EER Example
Department
Participation
1
N
Cardinality
Employee
N
Assigned To
M
Project
3DiagramsEER vs. UML
Class
Attributes
Methods
Structured Domain
Entity Type vs. Class Attribute Composite
Attribute vs. Structured Domain
4EER vs. UMLComplete Diagram
1..1
Min participation (0 or some int n ngt0)
0..
Department
1
Is In
N
Max Cardinality
N
0..
Assigned To
M
0..
Project
5EER Derived Attributes - Include in Department
the average salary of the employees in the
department.
Employee
Department
Class Method
6EERMulti-valuedAttributes
- EER Multi-valued
- as Entity
N
3
Student
Student
Major_Program
Major
UML
0..
0..3
7Weak Entities
EER Weak Entity
8Aggregations
Location
Location
Department
Project
No
No
Name
No
Name
Project Name No
0..
1..
1..1
0..
Location Name
9Example University Database
- Superclasses Subclasses
- Generalization Specialization
- Inheritance
Employee
U
Person
Grad Student
U
U
Student
U
Superclass instance must always exist.
Undergrad Student
10UML Superclass/SubclassInheritance
EER UML disjoint overlapping
11Object-Oriented Approach Motivation
- Object-Oriented Databases (OODB)
- Add persistence to object-oriented programming
languages
- Object Relational Databases (ORDBMS)
- Add user-defined methods to relational databases
- Allow grouping of relations into more complex
objects
12Relational is Good For
- Fixed format data
- Transaction processing
- simple short transactions
- Concurrency control
- Recovery from crashes
- Query processing and Query optimization
- relational algebra and mathematical logic
operations.
13Problems
- The relational model has no notion of a single
object. - Context with the real world
- e.g., spatial context.
- Aggregation functions may be desired
- The notion of re-use cannot be exploited
- There may also be versions or variant
configurations - i.e variations of the same design.
14 Problems With the Relational Model - 1
- Nonhomogeneous collection of design objects.
- Data Types images, matrices, vectors variable
length. - Temporal and/or spatial data.
- Many data types few instances of each type.
15Problems With the Relational Model - 2
- Schemas evolve during design.
- Long running transactions "checkout a design".
- Versions design log.
16Problems With the Relational Model - 3
- Functions needed
- Making a design permanent,
- Releasing design to production,
- Archiving design,
- etc.
- Library of design objects
- minimize redundancy.
17 Object-Oriented Concepts - 1
- Complex Objects
- sets,
- bags,
- lists,
- arrays,
- tuples.
18Object-Oriented Concepts - 2
- Object Identity identify by object id (oid)
rather than by an attribute value, never changes. - Encapsulation Operations and Data available to
user. - Implementation hidden. No other operations
available.
19Object-Oriented Concepts - 3
- Types and/or Classes
- Type
- Interface and Implementation.
- Types declared, checked at compile-time
- Class
- Instances created at run-time
20Object-Oriented Concepts - 4
- Class or Type Hierarchies
- Inheritance both data and function
- example student undergraduate, graduate
- Overriding, overloading, and late binding
- Polymorphism
21Object-Oriented Concepts - 5
- Computational Completeness
- Extensibility
- Means to define new types.
- User types not distinguished from system types.
- Persistence
- Not present in OO programming languages.
- Should be implicit not explicit.
22Object-Oriented Concepts - 6
- Secondary Storage Management
- Concurrency
- Recovery
- Ad Hoc Query Facility
23Review Object
- State (value)
- Behavior (operations)
- Signature or interface operation name and
arguments - Method or body implementation
- Identified by unique Object Identifier (OID)
24Class
- Group of similar objects
- Class hierarchies
- Inheritance
- Persistence must be specified explicitly
- Via entry point
- Via reachability
25Type Hierarchies and Inheritance(EER
superclass/subclass relationship)
PERSON Name, Address, Birthdate, Age,
SSN EMPLOYEE subtype-of PERSON Salary,
HireDate, Seniority STUDENT subtype-of PERSON
Major, GPA EMPLOYEE Name, Address, Birthdate,
Age, SSN, Salary, HireDate, Seniority STUDENT
Name, Address, Birthdate, Age, SSN, Major, GPA
26Object Data Management Group (ODMG)
- Object Model
- Object Definition Language (ODL)
- Object Query Language (OQL)
- Bindings to object-oriented programming languages
- C, Java, Smalltalk