Software Design
Architecture Design
Cohesion
Degree of interaction within a module
Coincidental Cohesion
- A module has coincidental cohesion when if it performs multiple, completely unrelated actions
- Problem
- Degrades maintainability
- Modules are not reusable
- Solution
- Break into separate modules
Logical Cohesion
- A module has logical cohesion when it performs a series of related actions, one of which is selected by the calling module
- Problem
- The interface is difficult to understand
- Code foe more than one action may be interwined
- Difficult to reuse
- Solution
Temporal Cohension
- A module has temporal cohesion when it performs a series of actions related in time
- Problem
- Actions of the module are weakly related to one another, but strongly related to actions in other modules
- Not reusable
- Solution
*
Procedural Cohesion
- A module has procedural cohesion if it performs a series of actions related by the procedure to be followed by the product
- Probelm
- Actions are still weakly connected
- Not reusable
- Solution
*
Communicational Cohesion
- A module has communicational cohesion if it performs a series of actions related by the procedure to be followed by the product, but in addition all the actions operate on the same data
- update record in database and write it to audit trail
- calculate new coordinated and send them to terminal
- Problem
- Not flexible if intending to focus on some of the activities
- lack of reusability
- Solution
*
- A module has communicational cohesion if it performs a series of actions related by the procedure to be followed by the product, but in addition all the actions operate on the same data
Functional Cohesion
- Module with functional cohesion performs exactly one action
- get temperature of furnace
- 2
- 3
- All of the element contribute to the performance of a single specific task
- Advantage
- More reusable
- Corrective maintenance easier
- Easier to extend product
Informational Cohesion
- A module has informational cohesion if it performs a number of actions, each with its own entry point, with independent code foe each action, all performed on the same data structure
- Advantage
Coupling
- Content Coupling
- Problem
- Almost any change to one module require change to another
- Problem
- Common Coupling
- Two modules are common coupled if they have write access to global data
- Problem
- Modules can have side-effects
- Affects readability
- entire module must be read to find out its function
- difficult to reuse
- expose to more data than necessary
- Control Coupling
- Two mudules are control coupled if one passes an element of control to the other
- Operation code passed to the module
- Control-switch passed as argument
- Can be both good and bad depends on the parameters
- Problem
- not independent: Module b must know internal structure and logic of module a
- Affects reusability
- Stamp Coupling
- Two modules are stamp coupled if a data structure is passed as a parameter, but the called module operated on some but not all of the individual components of the data structure
- Problem
- Not clear, without reading the entire module, which fields of a record are accessed or changed
- Difficult to understand
- Unlikely yo be reusable
- Uncontrolled data access can lead to computer crime
- Not clear, without reading the entire module, which fields of a record are accessed or changed
- Solution
- Use simple data structures
- Define class depend on interface
- Data Coupling
- Two modules are data coupled if all parameters are homogeneous data items
- display time of arrival(flight number)
- Compute product(first, second)
- Get job with highest priority(job que)
Tools
- Hierarchy chart
- Hierarchy plus Input-Process-Output = HIPO
Detailed Design
- Flowchart
- Problem Analysis Diagram
- N-S Digram