Download presentation
Presentation is loading. Please wait.
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 UML and the Unified Process McGraw-Hill, 2004 Stephen R. Schach srs@vuse.vanderbilt.edu
2
Slide 19.2 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. CHAPTER 19 INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS
3
Slide 19.3 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter Overview l Files and Their Problems l Tables l Traditional Database Systems l Object-Oriented Database Systems l Database Design and the Unified Process l The Future of Object-Oriented Database Management Systems
4
Slide 19.4 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Definitions l Database –A collection of data records organized to facilitate the storage and retrieval of the data by information systems l Database management system –The software that runs a database
5
Slide 19.5 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems l The mailing list for STAMbury Philatelic Society (STAMPS) l Version 1: Typewriter –Data are volatile –This approach is totally unacceptable
6
Slide 19.6 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Version 2: Computer files l Two independent programs –Program A: Writes name and address data to disk –Program B: Prints mailing labels from the file data
7
Slide 19.7 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Deployment diagram of a computer and its disk
8
Slide 19.8 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Version 3: Program A needs to be modified –Members resign –Members change their names and addresses, –New members join l Program A needs to be a CRUD program –Create –Read –Update and –Delete l Program B is unchanged
9
Slide 19.9 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Statechart for Version 3
10
Slide 19.10 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Typical data used by Program B
11
Slide 19.11 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Topical (or thematic) stamp collectors –Collect stamps relating to a specific topic l STAMPS members collect stamps that depict –Chess games –Fictional detectives –Elephants
12
Slide 19.12 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Version 4: STAMPS now wants to send out separate mailings to members of the three topical groups l Alternative 1: –Program A is changed to incorporate topical interests –Program B is modified accordingly
13
Slide 19.13 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l The topical collecting interests of six members of STAMPS
14
Slide 19.14 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Alternative 2: –Do not change Program A or Program B –Divide the data file into three separate files,one for each topical group
15
Slide 19.15 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Separate files for each topical group
16
Slide 19.16 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Problem 1: –A mailing to all members of stamps can lead to duplication or triplication »Example: Ngaio Alleyn –Redundant information
17
Slide 19.17 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Problem 2: –A change of address may require changes to more than one file »Example: Ngaio Alleyn –Update anomaly
18
Slide 19.18 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Files and Their Problems (contd) l Problem 3: –Deletion from a topical group may result in removal from the STAMPS database »Example: Dorothy Wimsey –Deletion anomaly
19
Slide 19.19 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables l Membership list table incorporating membership number
20
Slide 19.20 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables (contd) l Membership tables for the three topical groups
21
Slide 19.21 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables (contd) l This solves all three problems l 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
22
Slide 19.22 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables (contd) l Problem 2: –A change of address is made to the (unique) entry in the membership list table
23
Slide 19.23 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables (contd) l Problem 3: –A deletion from the membership table of a topical group does not change the membership list table entry
24
Slide 19.24 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables (contd) l 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
25
Slide 19.25 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Tables (contd) l The information system can be extended to incorporate additional information
26
Slide 19.26 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems l 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
27
Slide 19.27 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l The software of the STAMPS information system is explicitly written to manage the data –Program A and Program B
28
Slide 19.28 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l Information systems use a database management system for –Writing of data to disk and –Retrieval of data from the disk l Examples: –Mainframe: DB2, Oracle, Informix, Sybase –Personal computers: Microsoft Access
29
Slide 19.29 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l Database instructions are embedded within the source code, frequently written in COBOL
30
Slide 19.30 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l 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"
31
Slide 19.31 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l The COBOL code first passes through a precompiler –To convert the instructions to the database management system into COBOL l The resulting all-COBOL program is then compiled, linked, and run in the usual way l When the database instruction is executed –The database management system searches the database for Joe Soap, and –Returns his address to the COBOL program
32
Slide 19.32 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l Execution of the database instruction
33
Slide 19.33 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l Database instructions can be embedded within many traditional programming languages –Including C and COBOL l Typical database instructions include –Retrieve –Insert –Delete, and –Update
34
Slide 19.34 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Traditional Database Systems (contd) l The database management system manages the database itself l The programmer writes code to –Invoke the database management system, and –Provide it with data it needs
35
Slide 19.35 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems l A company with a traditional database management system is unlikely to use object-oriented database management systems for some time l They are still too complex –An extensive background in object-oriented database theory is needed
36
Slide 19.36 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l 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
37
Slide 19.37 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l Solution 1: Two databases –The one traditional, and –The other object-oriented
38
Slide 19.38 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l However, a major reason for using a database is to have just one copy of each record l Two databases means having –Two copies of all data, and –Two versions of every new information system l This is totally ridiculous
39
Slide 19.39 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l 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
40
Slide 19.40 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l The database management system must –Manage the database (as before), and –Perform conversions from traditional to object-oriented systems, and vice versa
41
Slide 19.41 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l 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 l After retrieving a record from the traditional database, it must –Insert the record into an object
42
Slide 19.42 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Database Design and the Unified Process l Using a database management system is easy, but l Designing a database requires specialized skills –Including detailed knowledge of the theory of databases
43
Slide 19.43 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Database Design and the Unified Process l The Information Systems curriculum usually includes at least one course on databases –This material is not included in the Systems Analysis and Design course l Similarly –The Unified Process does not include database design
44
Slide 19.44 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Future of O-O Database Management Systems l Object-oriented database management systems will become as easy to use as traditional database management systems l 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
45
Slide 19.45 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Future of O-O Database Management Systems l New companies will use the object-oriented paradigm for both –Its information systems, and –Its database management system
46
Slide 19.46 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l 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
47
Slide 19.47 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Database Systems (contd) l 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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.