+ All Categories
Home > Documents > Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc....

Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc....

Date post: 01-Jan-2016
Category:
Upload: cori-ball
View: 221 times
Download: 0 times
Share this document with a friend
Popular Tags:
43
Chapter 12 Chapter 12 View Design and Integration
Transcript
Page 1: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

Chapter 12Chapter 12

View Design and Integration

Page 2: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Outline Outline

Motivation for view design and integrationView design with formsView integration

Page 3: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Why View Design and Why View Design and IntegrationIntegration??Database complexity reflects

organizational complexity.Time-consuming and labor-intensive

processCollect requirements from different user

groupsCoordination among designer team

membersManage complexity of large designs

Page 4: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Managing ComplexityManaging Complexity

As the “divide and conquer” strategy is used to manage complexity, view design and integration is an approach to managing complexity of the database design effort.

Page 5: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Overview of View Design and Overview of View Design and IntegrationIntegration

Viewdesign

Viewintegration

Views

Conceptual schema

InterviewsDocumentation

Proposedforms/reports

Conflictidentification

Conflictresolution

Page 6: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

View Design with FormsView Design with Forms Important source of database requirementsReverse the process described in the

Chapter 10Derive an ERD that is consistent with the

formFive step procedure

Page 7: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Sample Customer Order FormSample Customer Order Form

Order No: 1234 Order Date: 3/19/2003

Customer No: 1001 Customer Name: Jon Smith

Address: 123 Any Street

City: Seattle State: WA Zip: 98115

Salesperson No: 1001 Salesperson Name: Jane Doe

$5001

$1503

$1204

Unit PriceQuantity

R210

B138

M128

Product No

Table

Cabinet

Bookcase

Description

Customer Order Form

Parent(main form)

Child(subform)

Page 8: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Form AnalysisForm Analysis

Create an ERD to represent a formERD supports form and other

anticipated processingERD should be consistent with the formERD is a view of the database

Page 9: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Form Analysis StepsForm Analysis StepsStep 1: Defineform structure

Step 2: Identifyentity types

Step 3: Attachattributes

Step 4: Addrelationships

Step 5: Checkcompleteness and

consistency

Page 10: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Step 1: Define Form StructureStep 1: Define Form Structure

Construct a hierarchy that depicts the form structure

Most forms consist of a simple hierarchy where the main form is the parent and the subform is the child.

Complex forms can have parallel subforms and more levels in the hierarchy.

Page 11: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Hierarchical Form StructureHierarchical Form StructureParent Node

Order NoOrder Date

Customer No., Customer NameAddress, City

State, ZipSalesperson No

Salesperson Name

Child NodeProduct NoDescription

QuantityUnit Price

Page 12: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Step 2: Identify Entity TypesStep 2: Identify Entity Types

Split each node in the hierarchical structure into one or more entity types.

Make an entity type if a form field is a potential primary key and there are other associated fields in the form.

Page 13: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Entity Types for the Customer Entity Types for the Customer Order FormOrder Form

OrderOrder No

CustomerCustomer No

ProductProduct No

SalesPersonSalesPerson No

Page 14: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Step 3: Attach AttributesStep 3: Attach Attributes

Attach attributes to the entity types identified in the previous step

Group together fields that are associated with the primary keys found in Step 2

Form fields close together may belong in the same entity type

Page 15: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Attributes Added to the Entity Types Attributes Added to the Entity Types

OrderOrder No

Order Date

CustomerCustomer No

Customer NameAddress

CityStateZip

ProductProduct NoDescriptionUnit Price

OrderLineQuantity

SalesPersonSalesPerson No

SalesPerson Name

Page 16: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Step 4: Add RelationshipsStep 4: Add Relationships

Relationships involving the form entity type– Form entity type contains the form's primary key– Relationships between the form entity type and

other entity types derived from the parent node: usually 1-M.

– Add a relationship to connect the form entity type to an entity type in the child node

Add relationships to connect entity types derived from the child node if not already connected

Page 17: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Entity Relationship Diagram Entity Relationship Diagram

Customer NoCustomer NameAddressCityStateZip

Customer

Order NoOrder Date

Order

Product NoDescriptionUnit Price

Product

SalesPerson NoSalesPersonName

Salesperson

Makes

Takes

Contains

Quantity

Page 18: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Step 5: Check Completeness Step 5: Check Completeness and Consistencyand ConsistencyThe ERD should adhere to the diagram

rules specified in Chapter 5. In addition, the ERD should be consistent

and complete with respect to the form structure.

Explore diagram transformations as suggested in Chapter 6.

Page 19: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Consistency Rules for Consistency Rules for Relationship CardinalitiesRelationship Cardinalities1. In at least one direction, the maximum

cardinality should be one for relationships connecting entity types derived from the same node (parent or child).

2. In at least one direction, the maximum cardinality should be greater than one for relationships connecting entity types derived from nodes on different levels of the form hierarchy.

Page 20: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Analysis of M-Way Analysis of M-Way Relationships using FormsRelationships using FormsChoice between M-way and binary

relationships can be difficult.Data entry forms provide a context to

understand M-way relationships.An M-way relationship may be needed if a

form shows a data entry pattern involving three entity types.

Page 21: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Sample Project Purchasing Sample Project Purchasing FormForm

Project Purchasing Form

Purchase No.: P1234 Purchase Date: 3/19/2003

Project No.: PR1 Project Manager: Jon Smith

Part No. Supplier No. Quantity Unit Price

M128 S100 4 $120

M128 S101 3 $150

R210 S102 1 $500

Page 22: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

ERD for the Project Purchase ERD for the Project Purchase FormForm

PartNoPartName

PartSuppNoSuppName

SupplierProjNoProjName

Project

QtyPrice

IncludesPartUses

SuppUses

PurchaseNoPurchaseDate

Purchase

PurchUses

Makes

Page 23: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Sample Purchasing FormSample Purchasing Form

Purchasing Form

Purchase No.: P1234 Purchase Date: 3/19/2003

Supplier No.: S101 Supplier Name: Anytime Supply

Part No. Quantity Unit Price

M128 4 $120

M129 3 $150

R210 1 $500

Page 24: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

ERD for the Purchasing FormERD for the Purchasing Form

PartNoPartName

Part

SupplierNoSupplierName

Supplier

QtyPrice

Includes

PartUses

PurchaseNoPurchaseDate

Purchase

PurchUse

From

Page 25: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

View IntegrationView Integration

Combine individual views into a complete database design

Incremental and parallel integration approaches

Page 26: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Incremental ApproachIncremental Approach

Incremental viewintegration

Integrated ERD(Views 1 to n)

View nPartially Integrated ERD

Page 27: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Parallel ApproachParallel Approach

Parallel viewintegration

Integrated ERD(Views 1 to n)

View nERD

View 1ERD

...

Page 28: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Integration StrategyIntegration Strategy

Parallel viewintegration

Integrated ERD

Partially integratedERD for subset 1 ...

Incremental viewintegration

Incremental viewintegration

Partially integratedERD for subset n

View subset 1 View subset n...

Page 29: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Precedence RelationshipsPrecedence Relationships

Form A precedes form B if form A must be completed before form B.

Preceding forms typically provide data for subsequent forms.

Place forms with precedence relationships in the same view subset

Page 30: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Precedence ExamplePrecedence Example

Customerform

Productform

Orderform

Invoiceform

Product Designform

Product Mftg.form

Page 31: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Resolving Synonyms and Resolving Synonyms and HomonymsHomonymsSynonym: spelled differently but have

the same meaningHomonym: same sound and often the

same spelling but different meaningForms provide a context to resolveMajor part of standardizing a

vocabulary

Page 32: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

View Integration ExamplesView Integration Examples

Page 33: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Sample Invoice FormSample Invoice FormINVOICE FORM

Customer No.: 1273 Invoice No.: 06389 Name: Contemporary Designs Date: 3/28/2003

Address: 123 Any Street Order No.: 61384

City: Seattle State: WA Zip: 98105

Product No Description Qty Ord

Qty Ship

Qty Back

Unit Price

Total Price

B381 Cabinet 2 2 150.00 300.00

R210 Table 1 1 500.00 500.00

M128 Bookcase 4 2 2 200.00 400.00

Total Amount $1200.00

Discount 60.00

Amount Due $1140.00

Page 34: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Incremental Integration Incremental Integration ExampleExample The following 5 slides

demonstrate the Incremental Integration process by integrating the Invoice Form with the ERD for Customer Order Form

Page 35: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Form HierarchyForm HierarchyParent Node

Invoice NoDate

Customer No.Name, AddressCity, State, Zip

Order No., Discount

Child NodeProduct NoDescription

Qty Ord, Qty ShipQty Back

Unit Price, Total Price

Page 36: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Identify entity typesIdentify entity types and attach and attach attributesattributes

OrderOrder No

CustomerCustomer No

NameAddress

City, State, Zip

ProductProduct NoDescriptionUnit Price

ShipLineQty Ord.Qty Ship

Qty Back *Total Price *

InvoiceInvoice No.

DateTotal Amount *

Discount *Amount Due *

Page 37: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

List the form fields that match existing List the form fields that match existing entity typesentity types

Order No matches the Order entity type.

Customer No, Customer Name, Address, City, State, and Zip match the Customer entity type.

Product No, Description, and Unit Price match the Product entity type.

Page 38: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Analyze HomonymsAnalyze Homonyms

Revise the Customer entity type with two sets of address fields: billing address fields and shipping address fields.

Add shipping address fields to the Invoice entity type.

Create a new entity type (ShipAddress) with the shipping address fields.

Page 39: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Integrated ERD (incremental)Integrated ERD (incremental)

Customer NoCustomer NameAddressCityStateZip

Customer

Order NoOrder Date

OrderQuantity

OrderLine

Product NoDescriptionUnit Price

Product

SalesPerson NoSalesPerson Name

SalesPerson

Makes

Takes

Contains

UsedIn

Invoice NoDateShipAddrShipCityShipStateShipZipTotal AmountDiscountAmount Due

Invoice

Qty ShipQty OrdQty Back

ShipLine

ShipFor

ShipsIn

UsesProd

Page 40: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Parallel Integration ExampleParallel Integration Example

The difference between the parallel and incremental approaches is that integration occurs later in the parallel approach.

For the parallel approach, ERDs for forms must be constructed before merging.

Page 41: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

ERD for the Invoice FormERD for the Invoice Form

Customer NoCustomer NameAddressCityStateZip

Customer

Order No

OrderQty ShipQty OrdQty Back

ShipLine

Product NoDescriptionUnit Price

Product

Invoice NoDateTotal AmountDiscountAmount Due

Invoice

UsesProd

ShipFor ShipsIn

SentTo

Page 42: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

Integrated ERD (Parallel)Integrated ERD (Parallel)

Customer NoCustomer NameAddressCityStateZip

Customer

Order NoOrder Date

OrderQuantity

OrderLine

Product NoDescriptionUnit Price

Product

SalesPerson NoSalesPerson Name

SalesPerson

Makes

Takes

Contains

UsedIn

Invoice NoDateShipAddrShipCityShipStateShipZipTotal AmountDiscountAmount Due

Invoice

Qty ShipQty OrdQty Back

ShipLine

ShipFor

ShipsIn

UsesProd

Page 43: Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved.

SummarySummary

View design and integration is an important skill for designing large databases.

Manage complexity of large development efforts

The result of form analysis is an ERD that is a view of the database.

Two approaches for View Integration, incremental and parallel


Recommended