You have three alternatives to translate class hierarchies into relational tables: - Create only a table for the superclass (all attributes and associations of subclasses are moved to the table corresponding to the superclass with the possibility of taking a NULL value) - Create only tables for the subclasses: All attributes and associations of the superclass are repeated in each subclass - Create tables both for the superclass and for each of the subclasses. In this case, the PK of the subclasses is at the same table a FK to the superclass (this ensures that all identifiers in a subclass table correspond to an existing identifier in the superclass table. A join between both tables allows to recover the full information of the element)
The best strategy depends on the problem (for instance, the number of attributes in each class, the number of levels in hierarchy, whether the hierarchy is disjoint or not,...)
Tuesday, November 22, 2011
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2011
(120)
-
▼
November
(25)
- Retrieving Query Strings in Javascript
- Java - Profiling Or Tracing
- Eclipse RCP
- Rich Client Tutorial Part 1
- Junit Testing - Basic Tutorial
- Eclipse - Open an Existing Java Project
- Java - SOAP Http Post
- Object Oriented Design - Anti-Patterns
- Facade pattern
- Inheritace and ERD
- java Static methods vs singletons
- Singleton Basic
- MS Visio - Aggregation Symbol
- MS Vsio - Class diagram - return type as array or ...
- MS Vision ERD Diagram
- I Stalked Steve Jobs (And How To Get A Meeting Wit...
- Data Flow Diagram - n levels
- How do you create a context diagram?
- The Context Diagram
- Software Models
- Process Model (Data Flow Diagrams)
- Component Diagram
- Unified Modeling Language
- How to write effective Test cases, procedures and ...
- Debugging and Tracing Ajax Applications Overview
-
▼
November
(25)
No comments:
Post a Comment