Loading learning content...
In the modern software development landscape, professionals encounter two powerful visual modeling languages:
EER (Enhanced Entity-Relationship): The database designer's tool, focused on data structures, relationships, and persistence. Born from Peter Chen's 1976 ER model and extended through the 1980s.
UML (Unified Modeling Language): The software engineer's tool, a comprehensive notation covering requirements, architecture, behavior, and structure. Standardized by OMG in 1997, synthesizing earlier OO notations.
These aren't competing standards—they're complementary perspectives on the same underlying domain. A skilled practitioner understands both and knows when to use each.
The relationship between EER and UML illuminates fundamental questions:
By the end of this page, you will understand: (1) The historical relationship between EER and UML, (2) Detailed notation mappings between the two, (3) Conceptual correspondences and divergences, (4) Guidelines for choosing between notations, and (5) Translation techniques for moving between EER and UML.
Understanding the UML-EER relationship requires appreciating their distinct origins and eventual convergence.
The ER/EER Lineage (Database Community)
1976: Chen's ER Model → Conceptual database design
1977-1985: Semantic extensions → Generalization, specialization
1985+: EER consolidation → Inheritance, categories, constraints
EER evolved within the database community, always focused on data persistence—what to store, how to structure it, what constraints to enforce.
The UML Lineage (Software Engineering Community)
1970s-1980s: Various OO notations
- Booch Method (Grady Booch)
- OMT - Object Modeling Technique (James Rumbaugh)
- OOSE - Object-Oriented Software Engineering (Ivar Jacobson)
1994-1995: "Three Amigos" collaboration
1997: UML 1.0 standardized by OMG
2005: UML 2.0 major revision
UML evolved within software engineering, focused on complete system modeling—use cases, classes, sequences, states, components, and deployment.
| Aspect | EER | UML (Class Diagrams) |
|---|---|---|
| Origin Community | Database researchers | Software engineering (OO) researchers |
| Primary Purpose | Conceptual database design | Complete system modeling |
| Standardization | De facto (textbooks, tools) | Formal (OMG specification) |
| Focus | Data at rest (persistence) | Objects at runtime (behavior + structure) |
| Scope | Data model only | 14 diagram types covering all aspects |
| Typical User | Database administrators, data architects | Software developers, architects |
The Convergence
Despite different origins, EER and UML class diagrams model similar concepts—entities/classes, attributes, relationships/associations, inheritance. This isn't coincidental: both emerged from efforts to represent real-world domains computationally.
James Rumbaugh, one of UML's creators, explicitly acknowledged ER/EER influence when developing OMT (Object Modeling Technique), which became UML's class diagram foundation. Many EER concepts appear in UML:
Modern Practice
Today, professionals often need both:
Understanding the mapping enables translation between teams and tools.
Think of EER and UML class diagrams as dialects of the same conceptual language rather than entirely different languages. The core concepts (types, relationships, inheritance) are shared; the notation and emphasis differ.
The most direct comparison is between EER diagrams and UML class diagrams. Let's map the fundamental constructs.
Entity Type ↔ Class
Both represent templates for domain objects:
EER: UML:
┌───────────────┐ ┌─────────────────────┐
│ EMPLOYEE │ │ Employee │
├───────────────┤ ├─────────────────────┤
│ employee_id │ │ - employeeId: int │
│ name │ → │ - name: string │
│ salary │ │ - salary: decimal │
└───────────────┘ ├─────────────────────┤
│ + getSalary() │
│ + promote() │
└─────────────────────┘
Key differences:
| EER Construct | EER Notation | UML Equivalent | UML Notation |
|---|---|---|---|
| Entity Type | Rectangle | Class | Rectangle with 3 compartments |
| Attribute | Oval connected to entity | Attribute | Listed in middle compartment |
| Primary Key | Underlined attribute | Stereotype <<PK>> or constraint | Noted in attributes section |
| Relationship | Diamond with lines | Association | Line connecting classes |
| Relationship Name | Label on diamond | Association Name | Label on line (with direction triangle) |
| Cardinality | (1,N), (0,M), etc. | Multiplicity | 1, 0..1, , 1.., etc. |
| Generalization | Circle with lines to subtypes | Generalization | Hollow triangle arrow to superclass |
Relationship ↔ Association
EER Relationship: UML Association:
EMPLOYEE ───┬─── works_for ───┬─── DEPARTMENT
(N,1) (1,1)
↓ translates to ↓
┌──────────┐ works_for ┌────────────┐
│ Employee │ ────────────────→│ Department │
└──────────┘ * 1 └────────────┘
(many) (one)
Cardinality Notation Comparison:
| EER | Meaning | UML |
|---|---|---|
| (1,1) | Exactly one | 1 |
| (0,1) | Zero or one | 0..1 |
| (1,N) | One or more | 1..* |
| (0,N) | Zero or more | * or 0..* |
| (M,N) | Many-to-many (both sides) | * on both sides |
In EER, cardinality is often placed near the entity it describes. In UML, multiplicity is placed at the opposite end (near the target). This is a common source of confusion—always verify which end the numbers refer to.
Inheritance is where EER and UML align most closely—both directly support class/type hierarchies.
Basic Generalization Mapping
EER Specialization: UML Generalization:
EMPLOYEE ┌──────────┐
│ │ Employee │
(d) └────▲─────┘
┌──┴──┐ │
│ │ ┌─────┴─────┐
HOURLY SALARIED ┌┴─────┐ ┌───┴────┐
│Hourly│ │Salaried│
└──────┘ └────────┘
Both express: Hourly IS-A Employee, Salaried IS-A Employee.
Constraint Mapping
EER's specialization constraints have UML equivalents:
| EER Constraint | EER Notation | UML Constraint | UML Notation |
|---|---|---|---|
| Disjoint | 'd' in circle | {disjoint} | Constraint on generalization line |
| Overlapping | 'o' in circle | {overlapping} | Constraint on generalization line |
| Total | Double line to circle | {complete} | Constraint on generalization line |
| Partial | Single line to circle | {incomplete} | Constraint on generalization line (or omitted) |
| Attribute-defined | Discriminator label | Discriminator name | {discriminator = attrName} |
Complete Example with Constraints
EER:
VEHICLE
║ (total participation)
[d,vehicle_type] (disjoint, discriminator = vehicle_type)
┌──┴──┬───────┐
│ │ │
CAR TRUCK MOTORCYCLE
UML:
┌─────────┐
│ Vehicle │
└────▲────┘
│{complete, disjoint}
│{discriminator = vehicleType}
┌──────────┼──────────┐
┌───┴──┐ ┌────┴────┐ ┌──┴────────┐
│ Car │ │ Truck │ │Motorcycle │
└──────┘ └─────────┘ └───────────┘
Abstract Classes
UML has explicit notation for abstract classes (italicized name or <<abstract>> stereotype). EER doesn't have a direct equivalent, but total specialization implies the supertype is effectively abstract—no instances exist that aren't also in a subtype.
UML distinguishes interfaces (behavior contracts) from abstract classes (partial implementations). EER has no direct equivalent—all entity types are concrete. When mapping UML to EER, interfaces typically become relationship types or are omitted entirely (since they model behavior, not data).
Beyond basic correspondence, several advanced constructs require careful mapping.
1. Weak Entities ↔ Composite Aggregation
EER weak entities depend on their owners for identity. UML expresses this through composite aggregation (filled diamond):
EER Weak Entity: UML Composite Aggregation:
BUILDING ════ has ════ ROOM ┌──────────┐ 1 * ┌────────┐
(owner) (weak) │ Building │◆──────│ Room │
└──────────┘ └────────┘
The filled diamond (◆) indicates composition—the Room cannot exist without its Building.
2. EER Categories ↔ UML Interfaces/Abstract Classes
EER categories (union types) have no perfect UML equivalent. Options include:
EER Category: UML Options:
Person Company Bank Option A: Abstract class
│ │ │
└─────────┼─────────┘ ┌─────────────────┐
(U) │ <<abstract>> │
│ │ AccountHolder │
ACCOUNT_HOLDER └────────▲────────┘
┌────┴────┐
Person Company
Option B: Interface
┌───────────────┐
│<<interface>> │
│ IAccountHolder│
└───────▲───────┘
implements
Neither fully captures category semantics (entity belongs to exactly ONE of the parent types). Documentation must clarify.
| EER Construct | Best UML Mapping | Notes |
|---|---|---|
| Weak Entity | Composite Aggregation (◆) | Filled diamond indicates existential dependence |
| Category (Union) | Interface or Abstract Class | Semantics differ; document accordingly |
| Identifying Relationship | Composite Aggregation with qualifier | Partial key → qualifier on composition |
| Multivalued Attribute | Collection attribute or separate class | List<T> type or explicit association |
| Composite Attribute | Nested class or embedded value | «datatype» stereotype for value objects |
| Derived Attribute | Derived property (/name) | Slash prefix in UML indicates derived |
| N-ary Relationship | Association class | Diamond notation in UML for n-ary |
3. Relationship Attributes ↔ Association Classes
When EER relationships have attributes, UML uses association classes:
EER Relationship with Attributes:
STUDENT ───────── enrolled_in ───────── COURSE
│
┌────┴────┐
│ grade │
│ semester│
└─────────┘
UML Association Class:
┌─────────┐ ┌────────┐
│ Student │───────────────────│ Course │
└─────────┘ └────────┘
│
┌──────┴──────┐
│ Enrollment │ ← Association Class
├─────────────┤
│ grade │
│ semester │
└─────────────┘
4. Ternary Relationships
EER ternary (and higher) relationships require special handling in UML:
EER Ternary: UML Options:
SUPPLIER ─┐ Option A: Association class
│ Option B: Intermediate class
PROJECT ──┼── supplies
│ │ SUPPLIER ─┐
PART ─────┘ │ ├─→ Supply ←───── PROJECT
quantity PART ────┘ │
quantity
When mapping between EER and UML, some semantic nuances may be lost. Always document any aspects that the target notation cannot fully express. For example, EER total participation constraints may need explicit documentation in UML models.
Let's examine a complete example modeled in both notations to solidify the mappings.
Domain: University Course Registration
EER Diagram (Text Representation): ┌────────────────┐ │ PERSON │ │ SSN (PK) │ │ Name │ │ Email │ └───────┬────────┘ │ (o) ← Overlapping: Can be both ┌───────┴───────┐ │ │ ┌───────┴───────┐ ┌─────┴──────┐ │ STUDENT │ │ FACULTY │ │ StudentID │ │ FacultyID │ │ GPA │ │ Rank │ │ EnrollDate │ │ HireDate │ └───────┬───────┘ └─────┬──────┘ │ │ (d) (d) ┌───────┴───────┐ ┌────┴────┐ │ │ │ │ ┌───┴────┐ ┌───────┴┐ CHAIR REGULAR │UNDERGRAD│ │GRADUATE│ └────────┘ └────────┘ STUDENT ───(M,N)─── enrolled_in ───(M,N)─── COURSE │ │ CourseID ┌────┴────┐ │ Title │ Grade │ │ Credits │ Semester│ └─────┬───────┘ └─────────┘ │ belongs_to │ FACULTY ─(1,N)─ works_in ─(1,1)─ DEPARTMENT │ DeptID │ DeptName └─────────┘UML Class Diagram (Text Representation): ┌────────────────────────┐│ Person │├────────────────────────┤│ - ssn: String {id} ││ - name: String ││ - email: String │├────────────────────────┤│ + getContactInfo() │└───────────▲────────────┘ │ {overlapping} ┌──────┴──────┐ │ │┌────┴────┐ ┌─────┴────┐│ Student │ │ Faculty │├─────────┤ ├──────────┤│-studentId│ │-facultyId││-gpa │ │-rank ││-enrollDt │ │-hireDt │└────┬────┘ └────┬─────┘ │{disjoint} │{disjoint} ┌──┴──┐ ┌──┴──┐ │ │ │ │Undergrad Graduate Chair Regular ┌─────────┐ enrolled ┌────────┐ belongs ┌────────────┐│ Student │ *─────────────* │ Course │ *──────────1 │ Department │└─────────┘ │ ├────────┤ ├────────────┤ │ │-courseId│ │-deptId │ ┌───────┴───────┐│-title │ │-deptName │ │ Enrollment ││-credits │ └──────┬─────┘ ├───────────────┤└─────────┘ │ │-grade │ │1 │-semester │ │ └───────────────┘ works_in │ │* ┌───────────┘ │ ┌─────┴────┐ │ Faculty │ └──────────┘Many database modeling tools (ERwin, PowerDesigner, MySQL Workbench) can export to UML notation, and UML tools (Enterprise Architect, Visual Paradigm) can import ER models. Use automated translation when available, then review for semantic accuracy.
Both notations are valuable—the choice depends on context, audience, and purpose.
Use EER When:
Primary focus is database design
Data semantics are paramount
Using database-centric tools
Use UML When:
Modeling complete systems
Audience is software developers
Integration with development tools
Use Both When:
The 'best' notation is the one your team understands and uses consistently. A well-maintained EER model is better than an unmaintained UML model (and vice versa). Choose based on team skills and tooling, then be consistent.
When you need to convert between EER and UML (or maintain both), follow systematic translation approaches.
EER → UML Translation Algorithm
For each EER Entity Type E:
1. Create UML Class C with same name
2. Copy all simple attributes as UML attributes
3. For composite attributes: create embedded class or flatten
4. For multivalued attributes: use Collection<T> type
5. For derived attributes: prefix with '/' in UML
For each EER Relationship R:
1. Create UML Association between corresponding classes
2. Map cardinality: (0,1)→0..1, (1,1)→1, (0,N)→*, (1,N)→1..*
3. If R has attributes: create Association Class
4. Add role names if semantically significant
For each EER Specialization:
1. Create UML Generalization arrows to superclass
2. Add {disjoint} or {overlapping} constraint
3. Add {complete} if total, {incomplete} if partial
4. Note discriminator if attribute-defined
For each EER Weak Entity W:
1. Create UML class for W
2. Create Composition (◆) from owner to W
3. Mark partial key as qualifier if needed
| EER Element | UML Translation | Notes |
|---|---|---|
| Entity (rectangle) | Class (3-compartment box) | Add method compartment (empty if data-only) |
| Attribute (oval) | Class attribute | Use type: dataType format |
| Key (underlined) | {id} constraint or <<PK>> | Stereotype or constraint notation |
| Relationship (diamond) | Association (line) | Add name on line with direction |
| (1,1) cardinality | 1 multiplicity | At opposite end from EER placement |
| (0,N) cardinality |
| Or 0..* for explicitness |
| Specialization circle (d) | Generalization + {disjoint} | Triangle to superclass + constraint |
| Specialization circle (o) | Generalization + {overlapping} | Triangle to superclass + constraint |
| Total (double line) | {complete} constraint | All instances must be subtyped |
| Weak entity (double rectangle) | Class with composition | Filled diamond to owner |
| Category (U) | Interface or abstract class | Document "exactly one" constraint separately |
UML → EER Translation Considerations
Translating from UML to EER is often lossy because EER cannot express:
UML → EER Guidelines:
Tools like Enterprise Architect, Visual Paradigm, and PowerDesigner support bidirectional translation. However, always review automated translations—subtle semantic differences may require manual adjustment.
UML's extensibility mechanism—profiles—allows defining domain-specific notation extensions. The UML Data Modeling Profile adapts UML class diagrams specifically for database design, bringing them closer to EER semantics.
Standard UML Data Modeling Stereotypes
<<table>> Applied to classes representing database tables
<<column>> Applied to attributes representing columns
<<PK>> Primary key attribute
<<FK>> Foreign key attribute
<<unique>> Unique constraint
<<index>> Index definition
<<view>> Database view
<<schema>> Database schema container
Example: UML with Data Modeling Profile
┌─────────────────────────────────┐
│ <<table>> │
│ Employee │
├─────────────────────────────────┤
│ <<PK>> employee_id: INTEGER │
│ <<FK>> department_id: INTEGER │
│ <<column>> name: VARCHAR(100) │
│ <<column>> salary: DECIMAL(10,2)│
│ <<index>> idx_name │
└─────────────────────────────────┘
When to Use UML Data Modeling Profile
When to Stick with Traditional EER
Hybrid Approaches
Some organizations use:
This separation of concerns can be effective in large organizations with distinct database and development teams.
Beyond the data modeling profile, UML has profiles for SysML (systems engineering), MARTE (real-time), SoaML (service-oriented architecture), and more. Profiles make UML adaptable to many domains, but increase the notation's complexity.
We have explored the rich relationship between EER and UML, two complementary notations for modeling data and systems. Let's consolidate our understanding.
What's Next
With a thorough understanding of EER's relationship to UML, the final page of this module explores When to Use EER—practical guidelines for deciding when EER is the right tool, when basic ER suffices, and when alternative modeling approaches are more appropriate.
You now understand the relationship between EER and UML, including notation mappings, conceptual correspondences, and usage guidelines. This knowledge enables you to work effectively in environments using either or both notations.