Tip:
Highlight text to annotate it
X
Good, so let's understand why number two is the correct answer
here. Congratulations if you picked screen. In general we would
expect to see correlation between poor cohesion and poor [ sofa
00:00:10]. The reason that I wanted to put this in here is to
drive home the point that we care about method level code
quality and we care about code quality in terms of how classes
inter operate but they're essentially orthogonal. You can have a
class that has a single responsibility, but the responsibility
is implemented in terms of a small number of long methods that
have all kinds of other problems. Converse so you could have a
class with 300 short methods, each of which follows all the sofa
guidelines but there's too many of them because the class is
trying to do too many things. The bottom line is that with the
exception of the second statement, all three of them are trying
to make some connection between the quality of individual
methods in a class and whether that class is doing a good job of
only trying to do one thing. The message here is that those who
are generally orthogonal, you can't really conclude one form the
other. It is certainly the case that local use of methods at
least an indicator doesn't mean you must extract a class but
it's something that you would try to look at.