Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 582 Bytes

HIGH-COHESION.md

File metadata and controls

17 lines (12 loc) · 582 Bytes

High Cohesion

Problem

It is necessary to ensure that objects perform heterogeneous functions

Solution

Provide high engagement assignment of duties

Pros

Highly cohesive classes are easy to maintain and reuse

Cons

Sometimes it is unreasonable to use high cohesion for distributed server objects with weak cohesion Example:

How it works ?

If you want to learn how to easily determine whether this pattern is violated or not - 1) is there a class method prefix, 2) Are there any subgroups of the class by methods, should be 1 group (Single Responsibility), example: ;