The document introduces the concept-oriented model, which unifies domain and relation modeling. It discusses how traditionally, relations are defined in terms of domains and complex domains are defined in terms of other domains. However, relations cannot be defined in terms of other relations. The concept-oriented model addresses this by defining a concept as a couple consisting of an identity class and an entity class. Concepts allow modeling domain-specific references or foreign keys with a type-based mechanism and generalize the notion of classes.
2. RELATIONS AND DOMAINS
Domain:
Domain:
set of values
INT {1, 2, …, 32,… 64, …, 128, …}
set of values
Relation:
Relation:
set of tuples
set of tuples red green blue
CREATE TABLE ColorTable
CREATE TABLE ColorTable <32, 64, 128>
ColorTable <128, 64, 32>
INT red, green, blue
INT red, green, blue
Relations are defined in terms of domains
3. COMPLEX VALUES
Complex domain:
Complex domain:
INT {1, 2, …, 32,… 64, …, 128, …}
set of complex
set of complex
values
values red green blue
CREATE UDT Color <32, 64, 128>
CREATE UDT Color
INT red, green, blue
INT red, green, blue Color <128, 64, 32>
CREATE TABLE ColorTable <32, 64, 128>
CREATE TABLE ColorTable
ColorTable <128, 64, 32>
Color color
Color color
Complex domains are defined in terms of other domains
4. PROBLEM
INT {1, 2, …, 32,… 64, …, 128, …}
Relation as a type
Relation as a type
red green blue
CREATE ColorTable
CREATE ColorTable <32, 64, 128>
INT red, green, blue
INT red, green, blue ColorTable <128, 64, 32>
<…, ?, …>
MyTable <…, ?, …>
Relations (and domains) cannot be defined in terms of relations
5. CONCEPT
CHAR[8] 'aaa' INT {1, 2, …, 32,… 64, …, 128, …}
red green blue
ColorConcept <'aaa'> <32, 64, 128>
color
CONCEPT ColorConcept
CONCEPT ColorConcept
MyTable <…, 'aaa', …> IDENTITY
IDENTITY
CHAR[8] code
CHAR[8] code
ENTITY
ENTITY
INT red, green, blue
INT red, green, blue
Concept is a couple of one identity class and one entity class
6. CONCLUSION
Concepts unify domain (value) modeling and relation modeling
One construct instead of two
Concepts provide a type-based mechanism for modeling
domain-specific references or FK
Concepts generalize classes
More info: http://conceptoriented.org