Transcript Systems Analysis and Design Allen Dennis and Barbara Haley
Object Persistence Design
Chapter 13 Slide 1 PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Key Definitions
Object persistence
performance.
involves the selection of a storage format and optimization for Four basic formats used for object persistence are:
files, OO databases, object-relational, and relational databases
.
Slide 2 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
OBJECT PERSISTENCE FORMATS
Slide 3 PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Files
Sequential Access Data stored in order based on a particular attribute Typically efficient for reports using all or most of the file’s data Random Access Data stored in unordered fashion Typically efficient for finding individual records Slide 4 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Other files
Master files Transaction files Audit History Look-up Slide 5 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Customer Order File
Figure 13-1 Goes Here Slide 6 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Relational Databases
Primary key Foreign key Referential integrity Structured Query Language (SQL) Tables Joining tables Objects must be converted so they can be stored in a table Slide 7 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Object-Relational Databases
Relational databases extended to handle the storage of objects Use of user-defined data types Extended SQL Inheritance tends to be language dependent Slide 8 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Relational Database Example
Figure 13-3 Goes Here Slide 9 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Object-Oriented Databases
Two approaches Adding persistence extensions to OO languages Separate database management systems Extents Object ID assigned Some inheritance Repeating groups or multivalued attributes Mainly support multimedia applications Sharp learning curve Slide 10 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Selecting an Object Persistence Format
Slide 11 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Your Turn
A major university graduates about 10,000 students a year and the development office wants to build a web-based system to solicit and track donations.
What are the pros and cons of each data storage format for this sort of application?
Slide 12 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
MAPPING PROBLEM DOMAIN OBJECTS TO OBJECT PERSISTENCE FORMATS
Slide 13 PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Initial Points to Consider
Adding primary and foreign keys Unless they add too much overhead Data management functionality only in classes at data management layer May add overhead, but aids in portability and reuse Slide 14 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Appointment System Problem Domain and Data Management Layers
Slide 15 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Factoring Out Multiple Inheritance Effect
Slide 16 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Mapping Problem Domain Objects to ORDBMS Schema -- Rules
Slide 17 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Mapping Problem Domain Objects to ORDBMS Schema -- Example
Slide 18 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Maintain a Clean Problem Domain Layer
Modifying the problem domain layer can create problems between the system architecture and human computer interface layer The development and production costs of OODBMS may offset the production cost of having the data management layer implemented in ORDBMS Slide 19 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Mapping Problem Domain Objects to RDBMS Schema -- Rules
Slide 20 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
OPTIMIZING RDBMS-BASED OBJECT STORAGE
Slide 21 PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Dimensions of Data Storage Optimization
Storage efficiency storage space) (minimizing Speed of access time to retrieve desired information) (minimizing Slide 22 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Optimizing Storage Efficiency
Reduce redundant data Limit null values Multiple possible interpretations can lead to mistakes A well-formed logical data model does not contain redundancy or many null values Slide 23 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
The Steps of Normalization
Slide 24 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
First Normal Form (1NF)
Slide 25 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Second Normal Form (2NF)
Slide 26 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Third Normal Form (3NF)
Slide 27 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Optimizing Access Speed
Denormalization Clustering Intra-file Inter-file Indexing Slide 28 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Payment Type Index
Slide 29 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Guidelines for Creating Indexes
Use indexes sparingly for transaction systems Use many indexes to increase response times in decision support systems For each table Create a unique index based on the primary key Create an index based on the foreign key Create an index for fields used frequently for grouping, sorting, or criteria Slide 30 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Estimating Data Storage Size
Field Average Size (Characters) Order number Date Cust ID Last name First name State Amount Tax rate
Record Size
Overhead (30%)
Total Record Size
8 7 4 13 9 2 4 2
49
14.7
63.7
Initial Table Size 50,000 Initial Table Volume 3,185,000 Growth/Month Table volume @ 3 years 1,000 5,478,200 Slide 31 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Summary
There are four basic types of object persistence formats:
files (sequential and random access), object-oriented databases, object-relational databases,
and
relational databases
.
Tradeoffs between the formats make it necessary to consider which to apply in each environment Once the format has been selected, data storage needs to be optimized for
efficiency speed of access
.
and Slide 34 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.
Expanding the Domain
The Object Data Management Group is working on standardization of the OO database features. Check them out at:
http://www.odmg.org
Slide 35 PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved.