Top Banner
Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with UML and the Unified Process McGraw-Hill, 2004 Stephen R. Schach [email protected]
47

Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.1

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

An Introduction toObject-Oriented

Systems Analysis and Design with UML and

the Unified Process

McGraw-Hill, 2004

Stephen R. Schach

[email protected]

Page 2: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.2

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

CHAPTER 19

INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Page 3: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.3

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Chapter Overview

Files and Their Problems Tables Traditional Database Systems Object-Oriented Database Systems Database Design and the Unified Process The Future of Object-Oriented Database

Management Systems

Page 4: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.4

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Definitions

Database– A collection of data records organized to facilitate the

storage and retrieval of the data by information systems

Database management system– The software that runs a database

Page 5: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.5

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems

The mailing list for STAMbury Philatelic Society (STAMPS)

Version 1: Typewriter– Data are volatile– This approach is totally unacceptable

Page 6: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.6

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Version 2: Computer files

Two independent programs– Program A: Writes name and address data to disk– Program B: Prints mailing labels from the file data

Page 7: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.7

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Deployment diagram of a computer and its disk

Page 8: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.8

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Version 3: Program A needs to be modified– Members resign– Members change their names and addresses, – New members join

Program A needs to be a CRUD program– Create– Read– Update and – Delete

Program B is unchanged

Page 9: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.9

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Statechart for Version 3

Page 10: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.10

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Typical data used by Program B

Page 11: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.11

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Topical (or thematic) stamp collectors– Collect stamps relating to a specific topic

STAMPS members collect stamps that depict– Chess games– Fictional detectives– Elephants

Page 12: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.12

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Version 4: STAMPS now wants to send out separate mailings to members of the three topical groups

Alternative 1:– Program A is changed to incorporate topical interests– Program B is modified accordingly

Page 13: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.13

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

The topical collecting interests of six members of STAMPS

Page 14: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.14

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Alternative 2:– Do not change Program A or Program B– Divide the data file into three separate files,one for each

topical group

Page 15: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.15

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Separate files for each topical group

Page 16: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.16

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Problem 1:– A mailing to all members of stamps can lead to duplication

or triplication» Example: Ngaio Alleyn

– Redundant information

Page 17: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.17

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Problem 2:– A change of address may require changes to more than

one file» Example: Ngaio Alleyn

– Update anomaly

Page 18: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.18

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Files and Their Problems (contd)

Problem 3:– Deletion from a topical group may result in removal from

the STAMPS database» Example: Dorothy Wimsey

– Deletion anomaly

Page 19: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.19

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables

Membership list table incorporating membership number

Page 20: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.20

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables (contd)

Membership tables for the three topical groups

Page 21: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.21

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables (contd)

This solves all three problems

Problem 1: – To send a mailing to all members, extract (unique) data

from the membership list table– Program B requires minor changes to handle membership

numbers

Page 22: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.22

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables (contd)

Problem 2: – A change of address is made to the (unique) entry in the

membership list table

Page 23: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.23

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables (contd)

Problem 3: – A deletion from the membership table of a topical group

does not change the membership list table entry

Page 24: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.24

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables (contd)

To print mailing labels for just the members of one topical group, modify Program B to – Read each membership number from the membership list

of that topical group, and– Look up the corresponding name and address in the

membership list table

Page 25: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.25

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Tables (contd)

The information system can be extended to incorporate additional information

Page 26: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.26

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems

Almost all traditional database management systems are relational– Data are stored in tables– The primary key labels primary records– The primary key can be used to label records in other

tables—foreign key

Page 27: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.27

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

The software of the STAMPS information system is explicitly written to manage the data– Program A and Program B

Page 28: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.28

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

Information systems use a database management system for– Writing of data to disk and – Retrieval of data from the disk

Examples:– Mainframe: DB2, Oracle, Informix, Sybase– Personal computers: Microsoft Access

Page 29: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.29

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

Database instructions are embedded within the source code, frequently written in COBOL

Page 30: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.30

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

Finding the address of policyholder Joe Soap can be achieved with the database instruction

retrieve address of policyHolder

where firstName of policyHolder is "Joe"

and lastName of policyHolder is "Soap"

Page 31: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.31

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

The COBOL code first passes through a precompiler – To convert the instructions to the database management

system into COBOL

The resulting all-COBOL program is then compiled, linked, and run in the usual way

When the database instruction is executed– The database management system searches the

database for Joe Soap, and– Returns his address to the COBOL program

Page 32: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.32

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

Execution of the database instruction

Page 33: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.33

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

Database instructions can be embedded within many traditional programming languages– Including C and COBOL

Typical database instructions include – Retrieve– Insert– Delete, and– Update

Page 34: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.34

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Traditional Database Systems (contd)

The database management system manages the database itself

The programmer writes code to– Invoke the database management system, and – Provide it with data it needs

Page 35: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.35

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems

A company with a traditional database management system is unlikely to use object-oriented database management systems for some time

They are still too complex– An extensive background in object-oriented database

theory is needed

Page 36: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.36

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

When an existing database is converted into an object-oriented database– The existing traditional information systems cannot access

the new database– They have to be totally rewritten, at enormous cost

Page 37: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.37

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

Solution 1: Two databases– The one traditional, and– The other object-oriented

Page 38: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.38

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

However, a major reason for using a database is to have just one copy of each record

Two databases means having– Two copies of all data, and– Two versions of every new information system

This is totally ridiculous

Page 39: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.39

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

Solution 2: A hybrid system– An object-oriented information system interfacing with a

traditional database management system– Instructions are embedded in C++ or Java code

Page 40: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.40

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

The database management system must– Manage the database (as before), and– Perform conversions from traditional to object-oriented

systems, and vice versa

Page 41: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.41

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

When writing data to the traditional database it must– Extract the data from an object– Convert the data into a record, and– Write the record to the traditional database

After retrieving a record from the traditional database, it must– Insert the record into an object

Page 42: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.42

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Database Design and the Unified Process

Using a database management system is easy, but

Designing a database requires specialized skills– Including detailed knowledge of the theory of databases

Page 43: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.43

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Database Design and the Unified Process

The Information Systems curriculum usually includes at least one course on databases– This material is not included in the Systems Analysis and

Design course

Similarly– The Unified Process does not include database design

Page 44: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.44

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Future of O-O Database Management Systems

Object-oriented database management systems will become as easy to use as traditional database management systems

It will still be too expensive to convert existing databases and information systems to the object-oriented paradigm– However, new information systems will be written using

the object-oriented paradigm, but will interface with the traditional database

Page 45: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.45

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Future of O-O Database Management Systems

New companies will use the object-oriented paradigm for both – Its information systems, and– Its database management system

Page 46: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.46

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

Legacy systems are the biggest obstacle to the widespread utilization of object-oriented database management systems– Just as they are to object-oriented information systems in

general

Page 47: Slide 19.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.

Slide 19.47

Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.

Object-Oriented Database Systems (contd)

The object-oriented paradigm is the current choice for the development of new information systems– This will lead to the adoption of object-oriented database

systems in the future