IS 257 Fall 2006

1 / 63
About This Presentation
Title:

IS 257 Fall 2006

Description:

... vacations. It ships information about the dive vacation to ... It bills the customer for the vacation and for equipment rental or sales. IS 257 Fall 2006 ... – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0

less

Transcript and Presenter's Notes

Title: IS 257 Fall 2006


1
Database Design Conceptual Model (cont.) and UML
  • University of California, Berkeley
  • School of Information
  • IS 257 Database Management

2
Lecture Outline
  • Review (and continuation)
  • Database Design, Conceptual Model
  • Object-Oriented Modeling

3
Lecture Outline
  • Review (and continuation)
  • Database Design, Conceptual Model
  • Object-Oriented Modeling in UML

4
Database Design Process
Application 1
Application 2
Application 3
Application 4
External Model
External Model
External Model
External Model
Application 1
Conceptual requirements
Application 2
Conceptual Model
Logical Model
Conceptual requirements
Internal Model
Application 3
Conceptual requirements
Application 4
Conceptual requirements
5
Developing a Conceptual Model
  • Overall view of the database that integrates all
    the needed information discovered during the
    requirements analysis.
  • Elements of the Conceptual Model are represented
    by diagrams, Entity-Relationship or ER Diagrams,
    that show the meanings and relationships of those
    elements independent of any particular database
    systems or implementation details.
  • Can also be represented using other modeling
    tools (such as UML more later)

6
Developing a Conceptual Model
  • Building the Conceptual Model for the Diveshop
    database

7
Developing a Conceptual Model
  • We will look at a small business -- a diveshop
    that offers diving adventure vacations
  • Assume that we have done interviews with the
    business and found out the following information
    about the forms used and types of information
    kept in files and used for business operations...

8
Primary Business Operations
  • The shop takes orders from customers for dive
    vacations.
  • It ships information about the dive vacation to
    the customers.
  • It rents diving equipment for the divers going on
    the trips (these may include additional people
    other than the customer)
  • It bills the customer for the vacation and for
    equipment rental or sales.

9
Business Operations (cont.)
  • It arranges sub-trips to particular dive sites at
    the primary location
  • NOTE This needs expanding charter boats,
    divemasters, local dive companies
  • It provides information about the features of
    various sites to help customers choose their
    destinations.
  • Features include sea life found at the location
    and shipwrecks

10
Business Operations (cont.)
  • Each dive order (or sale or trip) is on an
    invoice to one customer.
  • Invoices contain
  • Line items for each type of equipment ordered,
  • Total amount due for the invoice,
  • Customer information
  • Name, address, phone, credit card info.
  • Note could be expanded with particular charter
    dates and time, dive boats, etc.
  • Information must be kept on inventory of dive
    equipment.
  • There are multiple types of dive equipment
  • The prices charged for sale or rental are
    maintained.

11
Business Operations (cont.)
  • Destination information includes
  • Name of the destination
  • information about the location (accomodations,
    night life, travel cost, average temperatures for
    different times of the year
  • Destinations have associated dive sites.
  • Dive Sites have associated features
  • Sea life
  • Shipwrecks
  • Note could be expanded to include the boats, etc
    that go to specific sites

12
Business Operations (cont.)
  • One record is kept for each order by a customer
    and will include the method of payment, total
    price, and location information. (I.e. Customers
    may have multiple orders)
  • The company needs to know how an order is to be
    shipped.
  • The shop has to keep track of what equipment is
    on-hand and when replacements or additional
    equipment is needed

13
Entities
  • Customer
  • Dive Order
  • Line item
  • Shipping information
  • Dive Equipment/ Stock/Inventory
  • Dive Locations
  • Dive Sites
  • Sea Life
  • Shipwrecks

14
Diveshop Entities DIVECUST
15
Diveshop Entities DIVEORDS
16
Diveshop Entities DIVEITEM
17
Diveshop Entities SHIPVIA
18
Diveshop Entities DIVESTOK
Reorder Point
On Hand
Cost
Equipment Class
Sale Price
Description
DiveStok
Rental Price
Item No
19
Diveshop Entities DEST
20
Diveshop Entities SITES
21
Diveshop Entities BIOSITE
22
Diveshop Entities BIOLIFE
23
Diveshop Entities SHIPWRCK
24
Functional areas
  • Ordering
  • Inventory
  • Supplies
  • Shipping
  • Billing
  • Location/Site Selection
  • We will concentrate on Ordering and Location/Site
    Selection (these are joined tasks)

25
Ordering
Customers place Orders Each Order needs Customer
information
26
Ordering
27
Ordering Normalization
28
Details of DiveItem
Were ignoring this part...
29
Ordering Full ER
Customer No
DiveCust
1
ShipVia
Destination Name
Customer No
Destination no
n
ShipVia
ShipVia
DiveOrds
1
n
n
Dest
1
1
Order No
Destination
Order No
n
DiveItem
Item No
n
1
DiveStok
Item No
30
Location/Site Selection
Destination No
Destination Name
Destination
Going to?
Dest
DiveOrds
31
Destination/ Sites
Destination Name
Customer No
Destination no
1
n
DiveOrds
Dest
1
Destination no
Order No
Destination
Site No
n
Sites
32
Sites and Sea Life 1
Multiple occurrences of sea life...
33
Diveshop ER diagram BioSite
34
Sites and Sea Life 2
35
Sites and Shipwrecks
36
DiveShop ER Diagram
1
n
1
n
n
1
1
1
n
n
1
1
1/n
n
n
n
1
1
37
What must be calculated?
  • Total price for equipment rental?
  • Total price for equipment sale?
  • Total price of an order?
  • Vacation price
  • Equipment (rental or sale)
  • Shipping

38
What is Missing??
  • Not really an enterprise-wide database
  • No personnel
  • Sales people
  • Dive masters
  • Boat captains and crew
  • payroll
  • No Local arrangements
  • Dive Boats
  • Charter bookings?
  • Hotels?
  • Suppliers/Wholesalers for dive equipment
  • Orders for new/replacement equipment
  • No history (only current or last order)

39
Tools for ER (and UML) diagrams
  • Microsoft Visio has a UML-like set of diagramming
    templates for databases
  • For Macs OmniGraffle has UML or spreadsheet
    templates that can be used for ER diagrams
  • More sophisticated (and open source) CASE tools
    are available such as
  • DBDesigner (optimized for MySQL databases)
  • Toad (freeware version)
  • Many other drawing packages have ERD available
    (sometimes as add-ons)

40
Lecture Outline
  • Review (and continuation)
  • Database Design, Conceptual Model
  • Object-Oriented Modeling in UML

41
Object-Oriented Modeling
  • Becoming increasingly important as
  • Object-Oriented and Object-Relational DBMS
    continue to proliferate
  • Databases become more complex and have more
    complex relationships than are easily captured in
    ER or EER diagrams
  • (Most UML examples based on McFadden, Modern
    Database Management, 5th edition)

42
Object Benefits
  • Encapsulate both data and behavior
  • Object-oriented modeling methods can be used for
    both database design and process design
  • Real-World applications have more than just the
    data in the database they also involve the
    processes, calculations, etc performed on that
    data to get real tasks done
  • OOM can be used for more challenging and complex
    problems

43
Unified Modeling Language (UML)
  • Combined three competing methods
  • Can be used for graphically depicting
  • Software designs and interaction
  • Database
  • Processes

44
CLASS
  • A class is a named description of a set of
    objects that share the same attributes,
    operations, relationships, and semantics.
  • An object is an instance of a class that
    encapsulates state and behavior.
  • These objects can represent real-world things or
    conceptual things.
  • An attribute is a named property of a class that
    describes a range of values that instances of
    that class might hold.
  • An operation is a named specification of a
    service that can be requested from any of a
    class's objects to affect behavior in some way or
    to return a value without affecting behavior

45
UML Relationships
  • An relationship is a connection between or among
    model elements.
  • The UML defines four basic kinds of
    relationships
  • Association
  • Dependency
  • Generalization
  • Realization

46
UML Diagrams
  • The UML defines nine types of diagrams
  • activity diagram
  • class diagram
  • Describes the data and some behavioral
    (operations) of a system
  • collaboration diagram
  • component diagram
  • deployment diagram
  • object diagram
  • sequence diagram
  • statechart diagram
  • use case diagram

47
Class Diagrams
  • A class diagram is a diagram that shows a set of
    classes, interfaces, and/or collaborations and
    the relationships among these elements.

48
UML Class Diagram
Class Name
List of Attributes
List of operations
49
Object Diagrams
50
Differences from Entities in ER
  • Entities can be represented by Class diagrams
  • But Classes of objects also have additional
    operations associated with them

51
Operations
  • Three basic types for database
  • Constructor
  • Query
  • Update

52
Associations
  • An association is a relationship that describes a
    set of links between or among objects.
  • An association can have a name that describes the
    nature of this relationship. You can put a
    triangle next to this name to indicate the
    direction in which the name should be read.

53
Associations
  • An association contains an ordered list of
    association ends.
  • An association with exactly two association ends
    is called a binary association
  • An association with more than two ends is called
    an n-ary association.

54
Associations Unary relationships
manager
55
Associations Binary Relationship
56
Associations Ternary Relationships
Part

Vendor
Warehouse
Supplies


57
Association Classes
Student
Course
Registers-for


Registration ________________ Term Grade ___
_____________ CheckEligibility()
Computer Account _________________ acctID Password
ServerSpace
issues

0..1
58
Derived Attributes, Associations, and Roles
Student _________ name ssn dateOfBirth /age
Course Offering ____________ term section time lo
cation
Course ____________ crseCode crseTitle creditHrs
Scheduled-for
Registers-for


1

Derived attribute


Derived role
/participant
age currentDate dateOfBirth
/Takes
Derived association
59
Generalization
60
Other Diagramming methods
  • SOM (Semantic Object Model)
  • Object Definition Language (ODL)
  • Not really diagramming
  • Access relationships display
  • Hybrids

61
Application of SOM to Diveshop
DIVECUST
Name
1.1
Address Street City StateProvince
ZIPPostalCode Country Phone FirstContact
1.1
1.1
1.1
1.1
1.1
1.1
1.1
1.1
DIVEORDS
1.N
62
DIVEORDS
DIVEORDS id OrderNo SaleDate
DIVECUST
SHIPVIA
DESTINATION
DIVEITEM
PaymentMethod CCNumber CCExpDate NoOfPeople Depart
Date ReturnDate VacationCost
63
Next Time
  • Logical Model
  • Normalization and the relational model
  • Implementing DBs in Access
Write a Comment
User Comments (0)