oopsolid-principlessingle-responsibility-principlecohesion

Is "high cohesion" a synonym for the "Single Responsibility Principle?"


Is high cohesion a synonym for the Single Responsibility Principle? If not, how are they different?


Solution

  • The are not the same thing.

    You can have a highly cohesive class that does not have just a single responsibility.