Escolar Documentos
Profissional Documentos
Cultura Documentos
Chapter 2
Database System Design
Updated 2010
1
D Development Activities
B Analysis Design ( Logical, Physical )
Implement-
ation
Business & Create Adjust data model to Design
information data model. a database storage &
S needs.
Y
S System
Class diagram
(classes &
List or diagram of
normalized tables
Specifications
for storage &
access methods
T require-
ments.
relationships)
and write
business rules.
(schema). (indexes), and
forms & reports
E Business
case.
Customer( CID, Name, …)
SalesPerson(EID, Name..)
S
2 of 18
D Unified Modeling Language (UML)
B Trendy notation for analyzing systems and often used with the
object orientation (OO) approach.
Activity diagrams The steps within a function (or procedure, use case).
S
3 of 18
D Class Diagram – Concepts
B
Entity: The “thing” in the real world tracked by the system.
S
4 of 18
D
B Examples from Pet Store Application
Entity: Customer
S Class: Customer, includes attributes and behavior (below)
Y places
T
Product Search
(B) Customer Profile
belongs to
E
NOTE: Assumed way of reading is left-right and top-down.
M If the relationship is drawn that way, the arrowhead is not necessary.
Arrowheads help when these rules are not followed (Figure B).
S
6 of 18
D Degree of Association
B According to Number of classes:
T worker
E Employee manager
M
S
7 of 18
D Multiplicity (Cardinality) of Associations
B
• Specification of the number of objects participating in a relationship.
Example:
S An employee must work in only one department, and one (each)
department has one or more workers.
Y
1..*
S Employee
works in
1..1 Department
M * 1 Department
S
Employee
works in
8 of 18
D Types of Associations based on
B Multiplicity
S One-to-many (1:M)
Y Employee Department
S
works in
E Employee
1 .. 1
Department
M works in
S And…
10 of 18
D
B 3. Ask the same question from the other side of the
relationship:
One (each) object on the right side of the association is
associated with how many objects on the left side?
S Minimally, maximally?
Y Employee
1..1 Department
S <employs
E 1..* 1..1
M Employee Department
<employs
S works in
places
Y * (many); in older notations – M, N
specific number, if known (3, 10); e.g., in
S part-whole relationship
Order
1..*
T 0..*
E Order_Item contains
M 1..*
Item
S .
NOTE: Some imprecision on Fig. 2.7 on p. 39 (3 rd ed.); Fig 2.8 on p 46 (4th ed.). 13 of 18
D Business Rules for Cardinality - Read/Write
B Business Rules:
1) One customer can place one or Customer
more orders,
S and each order is placed by
1..1
one places
Y and only one customer.
Order
more items,
T and an item can be listed on no 0..*
order or on many orders. contains
E Order_Item
Item
S .
14 of 18
D N-ary Association
B
*
Employee
*
*
S Component
* *
* Product
Y
S
Degree of association >= 3.
S
NOTE: Some imprecision on Fig. 2.8 on p. 40 (3 rd Ed.); Fig 2.9 on p. 46 (4th ed.). 15 of 18
D N-ary Association with Associative Class
Y Component
ComponetID
Assembly Product
ProductID
S Type
Name
Name
T Assembly
EmployeeID
E ProductID
CompID
M
S
16 of 18
D N-ary Association
Y Component
ComponentID
1 * Assembly * 1
Product
ProductID
S Type
Name
Name
T Assembly
EmployeeID
E CompID
ProductID
M
S
17 of 18
D
Focus on Keys: Generic vs. Unique
B
Product: specific model of car (ProductID is generic key