CS 1114 Chapter Notes - Chapter 10: Duplicate Code, Mutator Method, Loose Coupling

51 views3 pages

Document Summary

Observe ~ there are two terms that are central to describing the quality of a class design: coupling and cohesion. The degree of coupling indicates how tightly classes are connected. One should aim for loose coupling a low degree of coupling. The degree of coupling determines how difficult it is to make changes in a given application. It is advantageous to design classes in such a fashion that one small change does not result in many supplemental changes: example: tight coupling refers to the utilization of public fields and is not advantageous. Cohesion refers to the number and diversity of tasks for which a single unit of application is responsible. Cohesion is relevant for units of a single class and an individual method. In an ideal world, one unit of code should be responsible for one cohesive task (a task that can be seen as a logical unit).

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents