structured design - 1 © minder chen, 1997-2002 produce paycheck retrieve employee record global...

28
© Minder Chen, 1997- 2002 Structured design - 1 Produce Paycheck Retrieve Employee Record Global Data Store Offpage Calling Module Called Module System Device Module Module Name Normal Procedure (Subroutine) Call Module Name Library(Predefi ned) Module Global Data Store Used by Page-Jones Offpage Used by Page- Jones Sender Receive r Control Flag Data Data Structure Chart Notations

Upload: deirdre-page

Post on 13-Dec-2015

217 views

Category:

Documents


3 download

TRANSCRIPT

© Minder Chen, 1997-2002Structured design - 1Structured design - 1

Produce Paycheck

Retrieve Employee

Record

Global Data Store Offpage

Calling Module

Called Module

System Device

Module

Module Name

Normal Procedure (Subroutine) Call

Module Name

Library(Predefined) Module

Global Data Store Used by Page-Jones

Offpage

Used by Page-Jones

Sender

Receiver

Control Flag

DataData

Structure Chart NotationsStructure Chart Notations

© Minder Chen, 1997-2002Structured design - 2Structured design - 2

A

A,1 A,2 A,3

Call A,1Call A,2Call A,3

SequenceStructured Chart NotationsStructured Chart Notations

A

A,4A,3A,2A,1

Call A,1IF Tx-Code = “A” Then Call A,2ELSE IF Tx-Code = “B” Then Call A,3

ELSE IF Tx-Code =“C” THEN Call A,4

Decision

A

A,1 A,2 A,3 A,4

Call A,1Repeat

Call A,2Call A,3Call A,4

Until EOF = “true”

AA

A,3A,3A,1A,1 A,2A,2Statement X Statement T Statement Z

Statement X Statement T Statement Z

Call A,1 Statement X Statement Y StatementZ Call A,3

Call A,1 Statement X Statement Y StatementZ Call A,3

IterationIteration Lexical InclusionLexical Inclusion

© Minder Chen, 1997-2002Structured design - 3Structured design - 3

Structured Chart Notations (Contd.)Structured Chart Notations (Contd.)

Notations used by Page-JonesNotations used by Page-Jones

DecisionDecisionIterationIteration

Lexical Inclusion (The Hat Symbol)

Lexical Inclusion (The Hat Symbol)

© Minder Chen, 1997-2002Structured design - 4Structured design - 4

Structure Chart NotationsStructure Chart Notations

Interface Table

I/F# Input Output

1 A,B C

2 X Y,Z

Interface Table

1 2

Asynchronous Activation of a Subtask

Concurrent Activation Symbol

Information Cluster

A B C

D

Modules A, B, and C has exclusive access to Data D

Program X

Physical Packaging Boundary

© Minder Chen, 1997-2002Structured design - 5Structured design - 5

Answer to Problem 22.0 Enter Customer payments

2.5 Display Customer payment

2.32 Verify Customer account

2.21 Get Customer record

2.11 Key invoice remittance

2.4 write Customer payment transaction

2.3 Update A/R master

2.2 Add Customer information

2.1 Key remittance

2.33 Rewrite A/R record

2.22 Verify Customer account

2.31 Get receivable record

2.12 Key monthly statement remittance

Structure chart for program 2.0. Enter customer payment Exercise - 3

Remittance

EOT

Customer-ID

Invoice-remittance

Monthly-Statement-remittance

Customer-sold-to-name

Remittance

Remittance

Customer-sold-to-name

Customer-payment

Customer-ID

Customer-ID

Customer-IDCustomer-number

Customer-record

Customer-record

No-record-on-file

Valid-account

A/R-record

Old-A/R-record

New-A/R-record

No-record-on-file

Valid account

Posting-ok

© Minder Chen, 1997-2002Structured design - 6Structured design - 6

How would you partition this system?How would you partition this system?

© Minder Chen, 1997-2002Structured design - 7Structured design - 7

Type of Coupling

Tightness of Coupling

Goodness of Design

Normal Coupling

Data Coupling Stamp Coupling

Control Coupling

Common Coupling

Content Coupling

Loose

Tight

Good

Bad

© Minder Chen, 1997-2002Structured design - 8Structured design - 8

Normal CouplingNormal Coupling

A .

Call B .

A .

Call B using X,Y

.

B B

Module A and module B are normally coupled if - A calls B- B returns to A

All information passed between them are through parameter passing

XX YY

© Minder Chen, 1997-2002Structured design - 9Structured design - 9

UPDATE CUSTOMER

MASTER FILE

GET VALID INPUT

VALIDATE CUSTOMER

TRANSACTION

UPDATE MASTER

PUT CUSTOMER

MASTER

GET INPUT

GET CUSTOMER

MASTER

GET CUSTOMER

TRANS

Transaction

Transaction

Transaction is valid

Transaction

Master Record

Master Record

Acct Number

Master Record

Updated Master RecordMaster

RecordValid Trans-action

Updated Master Record

Valid Trans-action

© Minder Chen, 1997-2002Structured design - 10Structured design - 10

Data CouplingData CouplingCalculate

Monthly payment

of a House

Calculate Mortgage

Payment

Mortgage PaymentLoan Amount

Term

Interest Rate

Module A and module B are data coupled if - A calls B - B returns to A - All information passed between them are through parameter passing - Each parameter is a data element

© Minder Chen, 1997-2002Structured design - 11Structured design - 11

Stamp CouplingStamp Coupling

Calculate

Monthly Payment

of a House

Calculate

Mortgage

Payment

Mortgage PaymentCustomer Loan Record

Two module A and B are data coupled if - A calls B - B returns to A - All information passed between them are through parameter passing - A composite piece of data is passed from one module to another

© Minder Chen, 1997-2002Structured design - 12Structured design - 12

Control CouplingControl Coupling

Produce

paycheck

Retrieve Employee

Record

Produce

paycheck

Retrieve Employee

Record

Employee ID

Employee Record Employee Record

Employee ID

Tell the operator that “The Employee Record Is Not Found”

Employee Record Not Found

Control Flag Descriptive Flag

© Minder Chen, 1997-2002Structured design - 13Structured design - 13

Scale of CohesionScale of Cohesion

Types of Cohesion Visibility Strength of Cohesion Maintainability

Functional Black box

Functional Black box Sequential Not-quite soSequential Not-quite so

Communicational black boxCommunicational black box

Procedural Gray Procedural Gray

Temporal boxTemporal box

Logical TransparentLogical Transparent

Coincidental or white box Coincidental or white box

StrongStrong

WeakWeak

GoodGood

BadBad

© Minder Chen, 1997-2002Structured design - 14Structured design - 14

Structure Chart and DFD Structure Chart and DFD

This module is sequentially cohesive.This module is sequentially cohesive.

This module is communicationally cohesive.This module is communicationally cohesive.

© Minder Chen, 1997-2002Structured design - 15Structured design - 15

Simplify Communicational Cohesion Simplify Communicational Cohesion

Get Employee Name

Calculate YTD Total Deduction

Get Employee Name

Calculate YTD Total Deduction Get Employee Name Get Employee Name Calculate YTD Total DeductionCalculate YTD Total Deduction

Employee NameEmployee Name

Employee YTD Total Deduction

Employee YTD Total Deduction

Employee IDEmployee ID Employee IDEmployee IDEmployee IDEmployee IDEmployee YTD Total Deduction

Employee YTD Total Deduction

Employee NameEmployee Name

© Minder Chen, 1997-2002Structured design - 16Structured design - 16

Determine Module CohesionDetermine Module CohesionType of Cohesion Type of Cohesion

Does activities performed by the module related to a single problem-related task

Does activities performed by the module related to a single problem-related task

What relates the elements within the module ?

What relates the elements within the module ?

Neither data nor control

Neither data nor control

Is sequence important ?

Is sequence important ?

DataData

Flow of control

Flow of control

Is sequence important ?

Is sequence important ?

Are the activities performed by the elements in the same category?

Are the activities performed by the elements in the same category?

YESYES

YES YES

YESYES

NONO

NONO

NONO

FunctionalFunctional

SequentialSequential

CommunicationalCommunicational

ProceduralProcedural

TemporalTemporal

LogicalLogical

CoincidentalCoincidental

© Minder Chen, 1997-2002Structured design - 17Structured design - 17

DETERMINE CUSTOMER

DETAILS

FIND CUSTOMER

NAME

EVALUATE LOAN

STATUS

DETERMINE CUSTOMER

DETAILS

Customer Account Number

Customer Name

Customer Loan Status

Customer Loan Status

Customer Account Number

Customer Account Number

Customer Account Number

Customer Name

Customer Name

Customer Name

A Communicationally Cohesive Module at the Bottom of a Structure Chart

A Communicationally Cohesive Module Halfway Up a Structure Chart

Each of These Functionally Cohesive Module is at the Bottom of a Structure

© Minder Chen, 1997-2002Structured design - 18Structured design - 18

GET RANGES

GET TIMES

GET AZIMUTHS

GET SATELLITE

TRAJECTORY

GET ELEVATION

A Functionally Cohesive Module Very High in a Structure Chart

Satellite Trajectory

Elevation

Ranges

AzimuthsTimes

© Minder Chen, 1997-2002Structured design - 19Structured design - 19

The Impact of Module Numbers on CostThe Impact of Module Numbers on Cost

Inte

rmodule

Effe

cts (

Coupling)

Cost Due to

Cost Due toIntramodule Effects (Cohesion)

High

Low

Co

st

Number of ModulesSmall Large

© Minder Chen, 1997-2002Structured design - 20Structured design - 20

Four Basic Types of ModulesFour Basic Types of Modules

Coordinate control

Transform (Process)

Transform (Process)

Efferent (Output)

Efferent (Output)

Afferent (Input)

© Minder Chen, 1997-2002Structured design - 21Structured design - 21

Idea System Shape of a Structure ChartIdea System Shape of a Structure Chart

Afferent branch

Transform branch

Efferent branch

© Minder Chen, 1997-2002Structured design - 22Structured design - 22

Idea System Shape of a Structure ChartIdea System Shape of a Structure Chart

High fan-outHigh fan-out

High fan-inHigh fan-in

© Minder Chen, 1997-2002Structured design - 23Structured design - 23

The Procedure of Deriving Structure Charts from Data Flow Diagrams

The Procedure of Deriving Structure Charts from Data Flow Diagrams

Evaluate a detailed DFD

Type of DFD

Identify central transform of the DFD

Map to transaction structure Map to transform structure

Refined the Structure Chart

Identify transaction types and transaction center of the DFD

Transaction Analysis Transform

Analysis

© Minder Chen, 1997-2002Structured design - 24Structured design - 24

P

OUTPUTFUNCTION

C

P

INPUTFUNCTION

B

P

INPUTFUNCTION

D

P

OUTPUTFUNCTION

A

P

INPUTFUNCTION

C

POUTPUT

FUNCTIONB

P

TRANSFORMFUNCTION

A

P

TRANSFORMFUNCTION B

P

INPUTFUNCTION

A

BOUNDARYB

BOUNDARYA

D DATA STORE D

D DATA STORE B

D DATA STORE E

M

L

K

J

I

H

G

F

E

D

C

B

A

Afferent

CentralTransform

Efferent

Transform Analysis

© Minder Chen, 1997-2002Structured design - 25Structured design - 25

TRANSFORMFUNCTION

A

TRANSFORMFUNCTION

B

INPUTFUNCTION

A

INPUTFUNCTION

D

INPUTFUNCTION

B

OUTPUTFUNCTION

A

INPUTFUNCTION

C

OUTPUTFUNCTION

C

BOSS

CENTRALTRANSFORMCONTROLLER

OUTPUTFUNCTION

B

E & F

J & I

J

G & H

E, F, & GI

J

G

I

F

K

E

C

© Minder Chen, 1997-2002Structured design - 26Structured design - 26

Transaction Analysis

DFD

Get Customer Transactio

n

Get Customer Transactio

n

Get Customer Transactio

nGet

Customer Transactio

n Get Customer Transactio

n

Process Customer Transaction

Change Customer

Record

Add New Customer

Get Customer

Transaction

Delete Customer

Record

Tx-Code

Structure Chart

Customer Information System Main Menu

1. Add New Customer 2. Change Customer Record 3. Delete Customer Record

A Transaction Selection Screen

© Minder Chen, 1997-2002Structured design - 27Structured design - 27

Determine Implementation BoundariesDetermine Implementation Boundaries

ManualManualReal-timeReal-time

Batch

On-line

© Minder Chen, 1997-2002Structured design - 28Structured design - 28

Processor Model: Allocation of essential Model Components to Processors

Essential Model

Processor 1

Processor 2

Processor 3

Processor Level Implementation Model

Netware LAN

UNIX Server

T1

TCP/IP

Mainframe

Allocating processes and data stores to

processors