Skip to main content

Questions tagged [cohesion]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
39 votes
9 answers

How to determine if a class meets the single responsibility principle?

The Single Responsibility Principle is based on the high cohesion principle. The difference between the two is that a highly cohesive classes features a set of responsibilities that are strongly ...
user1483278's user avatar
  • 1,141
6 votes
2 answers

Does increasing the number of classes increase code complexity? [duplicate]

To illustrate the question, let's say we have two programmers of comparable skill that both solve the same problem. The code they turn out has roughly the same lines of code, but one programmer uses 5 ...
mortalapeman's user avatar
  • 1,613
3 votes
3 answers

Programming by Intention, Depth-First or Breadth-First?

Say I have the following graph of dependencies between procedures/functions/methods: o / \ v e / \ / \ r f l w That is, function o first calls function v, and then ...
fredoverflow's user avatar
  • 6,884
1 vote
4 answers

Is there multiple definitions for responsibility of class?

In the book UML 2 and the Unified Process from Arlow and Neustadt has been told: Analysis classes should have 3 to 5 responsibilities But as you know we have the SRP that tells us something else!! ...
flexibleHammer's user avatar