Modularity - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Modularity

Description:

Automobiles, what would happen if we merged the speedometer with the fender? Civil Engineers ... Bridges are generally built of composite structures which are ... – PowerPoint PPT presentation

Number of Views:110
Avg rating:3.0/5.0
Slides: 20
Provided by: mikemcc
Category:

less

Transcript and Presenter's Notes

Title: Modularity


1
Modularity
  • Lecture 16
  • CS 2335
  • 11/20/00

2
Modularity comes
  • Naturally to some - Mechanical Engineers
  • Automobiles, what would happen if we merged the
    speedometer with the fender?
  • Civil Engineers
  • Bridges are generally built of composite
    structures which are independent and self
    contained.
  • Not so natural to others
  • Logical decomposition for ECEs is not
    pre-ordained

3
ECE Logical Decomposition
  • Take a computer, please.

ALU
Registers
Shifter
4
Take another computer
AND Gates
OR Gates
NOT gates
5
So what makes for good or bad modularity (results
of decomposition)
  • Minimal interaction between modules (coupling)
  • Maximal interaction within a module (cohesion)

6
Cohesion
  • Coincidental cohesion (worst)
  • Logical Cohesion
  • Temporal Cohesion
  • Procedural Cohesion
  • Communicational Cohesion
  • Functional Cohesion (best)

7
examples
  • Coincidental - No basis for decomposition other
    than maybe module size or complexity.
  • Add 7 to the fifth parameter

8
Logical
  • A module that performs a series of related
    actions, one of which is selected by the caller.
  • A module performing all input and output (that
    is, to each and every device as well as types of
    output)

9
Temporal
  • Performs a series of actions related in time.
  • Open old master file., initialize sales district
    table...
  • Typically an initialization module (at start up,
    go initialize everything. Related by time, but
    not by action.
  • Two changes are needed if sales district table
    changes (initializer and manipulator)

10
Procedural
  • A series of actions related by a sequence of
    steps (versus time).
  • Actions are weekly connected
  • Read part number from db and update repair record
    on maintenance file.

11
Communicational
  • A series of actions related by the sequence of
    steps, but performed on the same data.
  • Update record in db and write it to the audit
    trail.

12
Functional
  • A module that performs one action or achieves a
    single goal
  • Get temperature of furnace.

13
Compute ave. daily temps At various sites
Initialize sums And open files
Close files And print Ave. temps
Create new temp record
Store temp record
Read in site, time And temp
Store record for Specific site
Edit site, time, or Temp field
14
Coupling
  • The degree of interaction between two modules
  • Data coupling (best)
  • Stamp coupling
  • Control coupling
  • Common coupling
  • Content coupling (worst)

15
Content coupling
  • A module branches to a local label of another
  • A module refers to local data of another in
    terms of some displacement within the module.

16
Common coupling
  • Shared global data

17
Control coupling
  • One module controls the logic of another
  • A module calls another, and the called module
    passes back a flag that tells the caller to take
    a specific action, versus the caller deciding
    what action to take

18
Stamp coupling
  • Passing a structure and not knowing what part of
    the structure will be modified.
  • E.g., a function passes the employee record to a
    function that calculates withholding.

19
Data coupling
  • Parameters are passed and structures that are
    passed are used completely by the called module.
Write a Comment
User Comments (0)
About PowerShow.com