It's not a secret anymore!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Understanding Coupling versus Cohesion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Understanding Coupling versus Cohesion" Watch "Understanding Coupling versus Cohesion" New topic
Author

Understanding Coupling versus Cohesion

Richard Broersma
Ranch Hand

Joined: Apr 28, 2009
Posts: 63

I purchased a SCJP test question practice tool.

One question is:

"Which of the following concepts is a measure of inter-class dependencies? "

My intuition is that coupling is related the concept of inter-class dependencies. However, according to the testing tool, Cohesion is a measure of inter-class dependencies.

I figure that my understand of cohesion must be incomplete because I can't seem to accept this as the correct answer.

Can anyone explain why inter-class dependencies are associated with cohesion and not coupling?
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
Richard,

You are correct. Coupling measures inter-class dependency. Cohesion measures how focused a class is. In other words, a class should do only a few very related things, as opposed to combining functionality that should be split in different classes to promote modularity and code reuse.


All code in my posts, unless a source is explicitly mentioned, is my own.
Richard Broersma
Ranch Hand

Joined: Apr 28, 2009
Posts: 63

Thanks for the clarification. I'll submit a bug report to the testing software.
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
Richard Broersma wrote:I purchased a SCJP test question practice tool.


Which one? I ask because you may be able to search this forum (or others, the internet is huge...) to find a list of exam errata.


SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
Richard Broersma
Ranch Hand

Joined: Apr 28, 2009
Posts: 63

This is the certification test tool that I am using. I would love to find errata for this tool.

http://www.ucertify.com/exams/SUN/CX310-066.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Understanding Coupling versus Cohesion
 
Similar Threads
Roles as Concepts
Low coupling??
Certified!
Coupling and Cohesion
what is coupling