Docsity

Decomposing Systems into Modules: A Approach by D.L. Parnas, Study notes of Computer Science

Toggle sidebar
bg1
1
Decomposing Systems into
Modules
๎šƒPaper One: On the Criteria To Be Used in Decomposing
Systems into Modules
-- by D. L. Parnas
๎šƒPaper Two: The Modular Structure of Complex Systems
-- by D.L. Parnas, P.C. Clements and D.M. Weiss
Overview
๎šŠPurpose
๎šŠA system design problem โ€“ KWIC index
๎šŠConventional approach
๎šŠUnconventional approach
๎šŠComparison
๎šŠCriteria used in discomposing the system
๎šŠAnother system design problem โ€“ OFP
๎šŠConclusion
Purpose
๎šŠModularization:
๎š„a mechanism for enhancing flexibility and
comprehensibility
๎š„Allowing shortening of development time
๎šŠEffectiveness of modularization
๎š„Depend on the criteria used in decomposing the
system
Philosophy of Modular
Programming
๎šŠA 1970 textbook by Gouthier and Pont
A well-defined segmentation of the project effort ensures system
modularity. Each task forms a separate, distinct program module. At
implementation time each module and its inputs and outputs are well-
defined, there is no confusion in the intended interface with other system
modules. At checkout time the integrity of the module is tested
independently; there are few scheduling problems in synchronizing the
completion of several tasks before checkout can begin. Finally, the
system is maintained in modular fashion, system errors and deficiencies
can be traced to specific system modules, thus limiting the scope of the
detailed error searching.
Major Advancement in the area
of Modular Programming
๎šŠThe development of coding techniques and
assemblers allows
๎šƒone module to be rewritten with little knowledge
of the code in another module
๎šƒModules to be reassembled and replaced without
reassembly of the entire system
Primary Goal of Decomposing
the System into Modules
9Managerial
Little need for communication
When implementing individual modules
Or changing individual modules
9Product flexibility
Change to one module will not cause change in another
9Comprehensibility
Whole system can be better understood
Better designed
All in all, lower cost
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Decomposing Systems into Modules: A Approach by D.L. Parnas and more Study notes Computer Science in PDF only on Docsity!

Decomposing Systems into

Modules

ยƒPaper One: On the Criteria To Be Used in Decomposing Systems into Modules -- by D. L. Parnas ยƒPaper Two: The Modular Structure of Complex Systems -- by D.L. Parnas, P.C. Clements and D.M. Weiss

Overview

ยŠ Purpose ยŠ A system design problem โ€“ KWIC index ยŠ Conventional approach ยŠ Unconventional approach ยŠ Comparison ยŠ Criteria used in discomposing the system ยŠ Another system design problem โ€“ OFP ยŠ Conclusion

Purpose

ยŠ Modularization: ย„ a mechanism for enhancing flexibility and comprehensibility ย„ Allowing shortening of development time

ยŠ Effectiveness of modularization ย„ Depend on the criteria used in decomposing the system

Philosophy of Modular

Programming

ยŠ A 1970 textbook by Gouthier and Pont A well-defined segmentation of the project effort ensures system modularity. Each task forms a separate, distinct program module. At implementation time each module and its inputs and outputs are well- defined, there is no confusion in the intended interface with other system modules. At checkout time the integrity of the module is tested independently; there are few scheduling problems in synchronizing the completion of several tasks before checkout can begin. Finally, the system is maintained in modular fashion, system errors and deficiencies can be traced to specific system modules, thus limiting the scope of the detailed error searching.

Major Advancement in the area

of Modular Programming

ยŠ The development of coding techniques and assemblers allows ยƒ one module to be rewritten with little knowledge of the code in another module ยƒ Modules to be reassembled and replaced without reassembly of the entire system

Primary Goal of Decomposing

the System into Modules

9 Managerial Little need for communication When implementing individual modules Or changing individual modules 9 Product flexibility Change to one module will not cause change in another 9 Comprehensibility Whole system can be better understood Better designed All in all, lower cost

Example

ยŠ A KWIC index system is studied

Some basic concepts used in the analysis

Concepts

ยŠ Module ย„ Responsibility assignment ยŠ Modularization ย„ System description ย„ Includes design decisions ย„ System level decisions

Now the KWIC index system

ยŠ Input ย„ Accepts an ordered sets of lines ย„ Each line an ordered set of words ย„ Each word an ordered set of characters ยŠ Any line can be circularly shifted ยŠ Output ย„ a listing of all circular shifts of all lines ย„ In alphabetical order

How does it work

ยŠ Input

How does it work II

ยŠ Output

work All play And no no play And Makes Jack a dull boy Jack a dull boy Makes dull boy Makes Jack a boy Makes Jack a dull And no play All work a dull boy Makes Jack

Cool and Useful

http://www.utdallas.edu/~agi012000/kwic3/index.html

Diagram One

Mod I Master Control

Input Output

Circular Shift Alphabetizing

core

1 (^2 )

4

Modularization Two (Mod II)

ยŠ Line Storage ยŠ Input ยŠ Circular Shifter ยŠ Alphabetizer ยŠ Output ยŠ Master Control

Looks familiar

But is it the same as Mod I?

Mod II: Line Storage

ยŠ Consists of functions or subroutines ยŠ Provides means by which user of the module may call on it ยŠ Examples: ย„ CHAR(r,w,c) ย„ SETCHAR(rpv, c, d) ย„ WORDS(r) ยŠ Restrictions in calling the routines ยŠ Additional routines ย„ Number of words in any line ย„ Number of lines currently stored ย„ Number of characters in any word ย„ DELINE ย„ DELWRD

Mod II: Input Module

ยŠ Reads the original lines

ยŠ Calls line storage module

ยŠ Have them store internally

Mod II: Circular Shifter

ยŠ Functions analogs of functions in module 1 CSCHAR(l,w,c) CSSETUP ยŠ create a line holder containing all of the circular shifts of lines

Mod II: Alphabetizer

ยŠ Consists of two functions ยŠ ALPH ย„ Called first ย„ Alphabetizing ยŠ ITH ย„ Serves as an index ย„ ITH(i) gives the index of the circular shift which comes ith in the alphabetical ordering

Mod II: Output Module

Give the desired printing of circular shifts

Mod II: Master Control

Similar to that of modularization one

Diagram Two

Mod II Master Control

Input

Output

Circular Shift (^) Alphabetizing

Line Storage

Diagram One

Mod I Master Control

Input Output Circular Shift Alphabetizing

core

1 (^2 )

4

Comparison

ยŠ Both will work ยŠ Algorithms used might be same ยŠ Identical runnable representation ยŠ Yet other representation different ย„ Changing ย„ Documenting ย„ understanding

Criteria

ยŠ Mod II: Information Hiding (IH) ย„ No longer correspond to steps in the processing ย„ Every module knows its design decision ย„ Other modules donโ€™t have this knowledge ย„ Interface reveals as little as possible

Conclusion

ยŠ Advise against ย„ decomposing a system based on flowchart ยŠ Propose ย„ Taking the IH approach ย„ Begin with a list of difficult design decisions ย„ Or design decisions which are likely to change ย„ Each module hides such decision from others

Complex System

ยŠ More about information hiding

ยŠ An example: OFP for A-7E aircraft

OFP

ยŠ Stands for Onboard Flight Program ยŠ A project for A-7E aircraft ยŠ SW by the Naval Research Lab ยŠ A real-time program ยŠ processes flight data ยŠ Controls displays for the pilot ยŠ Computes the aircraft position ยŠ Using internal navigation system ยŠ Must be accurate!!

Module Guide

ยŠ Top Level

Behavior Module

Hardware Module Software Design Module HM SM

BM

Second Level

HM

BM

SM

Extended computer

Device Interface

Shared services

ApplicationData Types

Filter Behavior System generation

BankerData

Physical Utility

Software utility

Function driver

Design Principle

ยŠ Criterion we mentioned before โ€“ IH ยŠ Likelihood to change ย„ System details likely to change independently should be secrets to itself ย„ Interfaces between modules include information less likely to change ยŠ Data structure ย„ Only accessible to modules inside itself ย„ Others obtain information by calling its access methods

Three Ways to Describe a

Modular Structure

ยŠ Roles played by individual modules ยŠ Secrets associated with each module ยŠ Facilities provided by each module Also called module specifications How to use the module What does the module do

Two Kinds of Secrets

ยŠ Primary secrets ย„ Hidden information ย„ Specified to the software designer ยŠ Secondary secrets ย„ Implementation decision ย„ When implementing the module

Summary

ยŠ Two system examples ยŠ Two modularizations ยŠ IH criterion is advisable ยŠ Flowchart approach is less desirable ยŠ Likelihood to change is an measurement of effectiveness of modularization

Resources

ยŠ The Modular Structure of Complex Systemsโ€“ by D. L. Parnas, P.C. Clements, D. M. Weiss ยŠ Enhancing Reusability with Information Hiding โ€“ by D. L. Parnas, P.C. Clements, D. M. Weiss ยŠ http://fxvcl.sourceforge.net/kwicIndex.html ยŠ http://www.utdallas.edu/~vxs037000/kwic/class_diagram.htm ยŠ http://www.ipsj.or.jp/members/Magazine/Eng/0906/article001. html ยŠ http://www.cacs.louisiana.edu/~arun/courses/453.Fall01/home/ assignment2/kwic1.9alpha.doc

Special Thanks

Help from Dr. Coppit