CSC/ECE 517 Summer 2008/wiki3 4 bk: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=Cohesion Explained=
=Cohesion Explained=
Cohesion is an element of object-oriented programming related to how well or how poorly a component of a program is compartmentalized.  High cohesion is the preferable state in which a component's implementation and "awareness" is contained within the respective component.  Low cohesion is the undesirable state in which the implementation crosses over the boundaries of the component into the rest of the program.  In short, the component [http://en.wikipedia.org/wiki/Encapsulation_%28classes_-_computers%29 encapsulates] its implementation.
Cohesion is an element of object-oriented programming related to how well or how poorly a component of a program is compartmentalized.  High cohesion is the preferable state in which a component's implementation and "awareness" is contained within the respective component.  Low cohesion is the undesirable state in which the implementation crosses over the boundaries of the component into the rest of the program.  In short, the component [http://en.wikipedia.org/wiki/Encapsulation_%28classes_-_computers%29 encapsulates] its implementation.  By adhering to the principle of encapsulation and forcing a program's components to remain compartmentalized, the process of implementing, testing, and maintaining the application become much more straightforward [Pressman].  Cohesion should not be confused with the closely related object-oriented design concept of [http://en.wikipedia.org/wiki/Coupling_%28computer_science%29 coupling].  Coupling is the degree to which modules interact with one another.  While a high level of cohesion is desirable, a minimal level of coupling in which modules intercommunicate as little as possible is the goal of a well thought out design.

Revision as of 23:29, 23 July 2008

Cohesion Explained

Cohesion is an element of object-oriented programming related to how well or how poorly a component of a program is compartmentalized. High cohesion is the preferable state in which a component's implementation and "awareness" is contained within the respective component. Low cohesion is the undesirable state in which the implementation crosses over the boundaries of the component into the rest of the program. In short, the component encapsulates its implementation. By adhering to the principle of encapsulation and forcing a program's components to remain compartmentalized, the process of implementing, testing, and maintaining the application become much more straightforward [Pressman]. Cohesion should not be confused with the closely related object-oriented design concept of coupling. Coupling is the degree to which modules interact with one another. While a high level of cohesion is desirable, a minimal level of coupling in which modules intercommunicate as little as possible is the goal of a well thought out design.