CSC/ECE 517 Summer 2008/wiki3 3 cd: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
Line 41: Line 41:
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]
[http://c2.com/cgi/wiki?CouplingAndCohesion Coupling and Cohesion]


[http://pages.cpsc.ucalgary.ca/~eberly/Courses/CPSC333/Lectures/Design/coupling.html Coupling Theory]


[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]
[[CSC/ECE 517 Summer 2008/wiki3 Assignment|Back to the assignment page]]

Latest revision as of 02:44, 1 August 2008

Problem Statement

We introduced the idea of low coupling in Lecture 20, and used the Observer pattern as an example in Lecture 23. But we've really only scratched the surface on what there is to know about achieving low coupling. Browse the Web and the ACM DL for other information, both theoretical and practical, and produce a guide to what there is to know about low coupling. Be sure to highlight those aspects that would be appropriate for inclusion in CSC/ECE 517.

Low coupling.

Coupling in Software Design can be either High or Low. What this means is that object and classes in your code can exist indepently of other objects or classes. Coupling between modules/components is their degree of mutual interdependence. For example a system that has high coupling might experience the following issues:

  • Change in one module forces a ripple of changes in other modules.
  • Modules are difficult to understand in isolation.
  • Modules are difficult to reuse or test because dependent modules must be included.

Examples of low coupling include.

  • size: low number of connections between routines
  • intimacy: minimal number of connections between routines
  • visibility: the prominence of the connection between routines
  • flexibility: the ease of changing the connections between routines

Coupling in Theory

Coupling level names are presented in order from worse to better: (high coupling is bad)

  • Content/Pathological Coupling : (worst) When a module uses/alters data in another
  • Control Coupling : 2 modules communicating with a control flag (first tells second what to do via flag)
  • Common/Global-data Coupling : 2 modules communicating via global data
  • Stamp/Data-structure Coupling : Communicating via a data structure passed as a parameter. The data structure holds more information than the recipient needs.
  • Data Coupling : (best) Communicating via parameter passing. The parameters passed are only those that the recipient needs.
  • No data coupling : independent modules.

Coupling in Practice

http://www.leansoftwareengineering.com/wp-content/uploads/2007/08/abc.jpg

Coupling is easy to measure and understand because it is mechanical in nature and requires less interpretation. Suppose there are three components A, B, and C. A's behavior depends upon B in some way (any way), A’s behavior depends upon C in some way, and the behavior of B and C do not appear to depend upon anything else.

That is the coupling of the system and it is measureable.

Links

What is Coupling Really?

Coupling on Wikipedia

Coupling and Cohesion

Coupling Theory

Back to the assignment page