Title: Advanced Data Modeling Concepts and Tools
1Advanced Data Modeling Concepts and Tools
- CS 95 Advanced Database Systems
- Handout 2
2 The Database Design Process (Revisited)
- Phases of Database Design
- Conceptual Design using Semantic Data
Modeling Tools, e.g. - Entity-Relationship Model
- Enhanced ER Model
- Object-oriented Data Model
- Object-relational Data Model
Steps in DB Design
Requirements Definition
Develop Conceptual Model
Logical/Physical Design
Design Application
Data-oriented approach - because data are more
stable than the functions (or processes) in an
organization.
3Database Design and Conceptual Data Modeling
- Analogous to analysis phase of software
development - Requirement Collection and Analysis
- - Designers interview database users to
understand and document data requirements. - Functional Requirements
- - User defined operations to be applied on the
database
4Database Design and Conceptual Data Modeling
(contd)
- Conceptual Design
- -Conceptual schema a permanent description of
database specifications. - - Capture the semantics of the data description
of data, constraints, relationships - - No storage or physical details yet
- - Use of semantic data modeling tools (e.g. ERD)
- - relational model is not a semantic data model
5What is a data model?
- Description in high-level model
- - Close to the user' view of mini-world
- - Abstract concepts
- - Means of communication between the
non-technical users and the developer - - Allows user to influence design and is
independent of any particular DBMS. - Examples ER, Enhanced ER, Object-Oriented and
Object-Relational Data Model - Unified Modeling Language (UML) - data modeling
subset (i.e., structural
modeling subset)
6Enhanced Entity-Relationship Model (Concepts/Featu
res)
- Subclass/superclass (or subtype/supertype)
- Specialization -- define subclasses
- Generalization -- define superclass
- Constraints on Specialization
- Disjointness (Disjoint or Overlap)
- Completeness (Total or Partial Specialization)
- Inheritance.
- Hierarchies and Lattices
- Union Types (Categories)
7Semantic Data Models
Most common database management systems represent
information in a simple record-based format,
semantic modeling
- provides richer data structuring capabilities for
database applications - provide mechanisms for representing structurally
complex interrelations among data typically
arising in commercial applications - complements work on knowledge representation (in
artificial intelligence) and on the new
generation of database models based on the
object-oriented paradigm of programming
languages.
8Enhanced ER Model (EER)
- EER Model ER Model Extensions
- Extensions
- - Subclass (Specialization)
- - Superclass (Generalization)
- - Category
- - Attribute and Relation Inheritance
9Subclass/Superclass
- Subclass Entities of an Entity type sharing a
set of attribute which are grouped
together - Superclass The parent entity type from which
subclasses are formed - Class/Subclass relationship Relationship between
a superclass and one of the subclasses - Specialization The process of forming subclasses
from a superclass
10Subclass/Superclass (contd.)
- Type Inheritance Member of subclass possessing
all attributes and relationships of a member of
superclass - Local Attributes Attributes that apply only to
members of a subclass (a.k.a. specific attribute) - Local Relationships Relationships applicable
only to members of a subclass(a.k.a. specific
relationships) - Generalization Process of forming a supercalss
from subclasses. (Functionally, inverse of
specialization)
11Specialization/Generalization Characteristics
- Several Specializations could be defined on the
same entity type (Superclass) - Specialization with single subclass is also
permitted - Predicate-defined subclass Specialization
specified by a condition on the value some
attribute of superclass. (a.k.a.
condition-defined) - Defining predicate Condition satisfied by all
members of a predicate-defined subclass
12Specialization/Generalization Characteristics
(contd.)
- Attribute-defined specialization All subclasses
having membership condition on the same attribute
of the superclass - Defining Attributes No condition exists for
determing membership in the subclass
13Specialization/Generalization Constraints
- Disjointness constraint Subclasses of the
specialization must be disjoint (an entity is a
member of at most one subclass) - - Overlapping Subclasses not constrained to be
disjoint - Completeness Constraint
- - Total Every entity in superclass must be a
member of some subclass (e.g.\HOURLY\_EMPLOYEE,
SALARIED\_EMPLOYEE\
14Specialization/Generalization Constraints (contd.)
- - Partial An entity in superclass may not be a
member of any subclass - Disjointness and Completeness are independent.
(leads to 4 possible constraints on
specialization) - - Disjoint, Total
- - Disjoint, Partial
- - Overlapping, Total
- - Overlapping, Partial
15Specialization Hierarchies and Lattices
- Subclass may have further subclasses, and so on.
- Specialization Hierarchy Every subclass
participates in only one
class/subclass relationship - Specialization Lattice A subclass can
participate in more than one
class/subclass relationship - Leaf Node A class that has no subclass
16Specialization Hierarchies and Lattices (contd
.)
- Shared Subclass A subclass with more than one
superclass - Multiple Inheritance A shared subclass
inheriting attributes and relationships from
multiple (super) classes
17Union Type/Categories
- Uniontype (Category) Subclass with
class/subclass relationship with more than one
superclass of different entity types - Category is a subset of the union of its
superclass - An entity in Category is a member of only one of
its superclass - Category types Total or Partial
18(No Transcript)
19(No Transcript)
20(No Transcript)
21(No Transcript)
22Object-Oriented Data Model
- Object models describe the system in terms of
object classes. An object class is an abstraction
over a set of objects with common attributes and
the services (operations) provided by each object
- Various object models may be produced
- Inheritance models
- Aggregation models
- Relation models
- Service models
- Object databases allow storage of complex data
types or objects and supports inheritance,
polymorphism, and encapsulation for full
object-oriented development
23Object-Oriented Data Model
- Natural ways of reflecting the real-world
entities manipulated by the system - More abstract entities are more difficult to
model using this approach - Object class identification is recognized as a
difficult process requiring a deep understanding
of the application domain - Object classes reflecting domain entities are
reusable across systems
24Key OO Concepts
- Classes
- Objects
- Methods/Operation
- Messages
- Inheritance
- Complex Objects
- Encapsulation
- Persistence
- Polymorphism/Operator Overloading
- Multiple/Selective Inheritance
25Approximate Equivalence of Object-Oriented and
Conventional Data Modeling Terms
- Object-Oriented
- Object
- Object Class
- Instance attribute
- Instance attribute constraint
- Method
- Message
- Conventional
- Record instance, row
- Record type, table
- Field
- Field type
- Procedure
- Procedure call
26Object-Oriented Data Model Example
Company
Person
Name Location Contact Name
Name Birthday
Vehicle
Serial Weight Wheelbase Manufacturer
Auto Company
Allocation Total Sales
Cargo Space
Set Type
Trunk capacity
Foreign Auto Company
Import Limits Trade Representative
Truck
Automobile
Motor Bike
Legend
Class-subclass
Attribute/aggregation association
27(No Transcript)
28(No Transcript)
29Object-Relational Data Model
- Hybrid data model combining relational and
object-oriented model features - Object-relational database is a hybrid type of
database, i.e., the relational database server is
usually extended to support objects as if they
are new data types
30Unified Modeling Language(UML)
31Why do we model?
- Provide structure for problem solving
- Experiment to explore multiple solutions
- Furnish abstractions to manage complexity
- Reduce time-to-market for business problem
solutions - Decrease development costs
- Manage the risk of mistakes
32Why do we model graphically?
- Graphics reveal data.
- Edward TufteThe Visual Display of Quantitative
Information, 1983 - 1 bitmap 1 megaword.
- Anonymous visual modeler
33UML - Quick Tour
- The UML is a graphical language for specifying,
visualizing, constructing and documenting the
artifacts of software systems - Added to the list of OMG adopted technologies in
November 1997 as UML 1.1 - Most recent minor revision is UML 1.3, adopted in
November 1999 - Next minor revision will be UML 1.4, planned to
be adopted in Q2 2001 - Next major revision will be UML 2.0, planned to
be completed in 2002
34UML Goals
- Define an easy-to-learn but semantically rich
visual modeling language - Unify the Booch, OMT, and Objectory modeling
languages - Include ideas from other modeling languages
- Incorporate industry best practices
- Address contemporary software development issues
- scale, distribution, concurrency, executability,
etc. - Provide flexibility for applying different
processes - Enable model interchange and define repository
interfaces
35OMG UML Contributors
Microsoft ObjecTimeOraclePtech OAO Technology
SolutionsRational SoftwareReich SAP Softeam Ster
ling Software Sun Taskon TelelogicUnisys
AonixColorado State University Computer
Associates Concept Five Data Access EDS Enea
Data Hewlett-Packard IBM I-LogixInLine
Software Intellicorp Kabira TechnologiesKlasse
Objecten Lockheed Martin
36Building Blocks
- The basic building blocks of UML are
- model elements (classes, interfaces, components,
use cases, etc.) - relationships (associations, generalization,
dependencies, etc.) - diagrams (class diagrams, use case diagrams,
interaction diagrams, etc.) - Simple building blocks are used to create large,
complex structures - cf. elements, bonds and molecules in chemistry
- cf. components, connectors and circuit boards in
hardware
37Unifying Concepts
- classifier-instance dichotomy
- e.g., an object is an instance of a class ORa
class is the classifier of an object - specification-realization dichotomy
- e.g., an interface is a specification of a class
ORa class is a realization of an interface - analysis-time vs. design-time vs. run-time
- modeling phases (process creep)
- usage guidelines suggested, not enforced
38What is structural modeling?
- Structural model a view of an system that
emphasizes the structure of the objects,
including their classifiers, relationships,
attributes and operations. - Data modeling is a subset of structural modeling
39Structural Modeling Core Elements
40Structural Modeling Core Elements (contd)
¹ An extension mechanism useful for specifying
structural elements.
41Structural Modeling Core Relationships
42Structural Modeling Core Relationships (contd)
43Structural Diagram Tour
- Show the static structure of the model
- the entities that exist (e.g., classes,
interfaces, components, nodes) - internal structure
- relationship to other entities
- Do not show
- temporal information
- Kinds
- static structural diagrams
- class diagram
- object diagram
- implementation diagrams
- component diagram
- deployment diagram
44Static Structural Diagrams
- Shows a graph of classifier elements connected by
static relationships. - kinds
- class diagram classifier view
- object diagram instance view
45Classes
Fig. 3-20, UML Notation Guide
46Classes compartments with names
Fig. 3-23, UML Notation Guide
47Classes method body
Fig. 3-24, UML Notation Guide
48Types and Implementation Classes
Fig. 3-27, UML Notation Guide
49Interfaces Shorthand Notation
Fig. 3-29, UML Notation Guide
50Interfaces Longhand Notation
Fig. 3-29, UML Notation Guide
51Associations
Fig. 3-40, UML Notation Guide
52Association Ends
Fig. 3-41, UML Notation Guide
53Ternary Associations
Fig. 3-44, UML Notation Guide
54Composition
Fig. 3-45, UML Notation Guide
55Composition (contd)
Fig. 3-45, UML Notation Guide
56Generalization
Fig. 3-47, UML Notation Guide
57Generalization
Fig. 3-48, UML Notation Guide
58Dependencies
Fig. 3-50, UML Notation Guide
59Dependencies
Fig. 3-51, UML Notation Guide
60Derived Attributes and Associations
Fig. 3-52, UML Notation Guide
61Objects
Fig. 3-38, UML Notation Guide
62Composite objects
Fig. 3-39, UML Notation Guide
63Links
Fig. 3-46, UML Notation Guide
64Constraints and Comments
Fig. 3-17, UML Notation Guide
65Class Diagram Examples
Adapted from Fig. 23 EJB 2.0.
66Adapted from Fig. 23 EJB 2.0.
67Adapted from Fig. 23 EJB 2.0.
68(No Transcript)