Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

8. Base Patterns > Cohesive Modules

Cohesive Modules

Statement

Module behavior should serve a singular purpose.

Description

Cohesion is a measure of how closely related and focused the various responsibilities of a module are. In the worst-case scenario, little emphasis is placed on the allocation of classes to modules. Instead, behavior is allocated randomly, and the likelihood that modules suffer from lack of cohesion is high. In the best-case scenario, modules exhibit high degrees of functional cohesion, and the entities composing the module each work in conjunction to fulfill module behavior.

In general, cohesion is a qualitative measurement that is difficult to measure objectively. Instead, we typically refer to a software module as possessing either high cohesion or low cohesion. Modules with higher degrees of cohesion are preferred.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial