"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?
Joined: Dec 16, 2008
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.