Cohesion is the degree to which the elements within a software component belong together. A cohesive element groups child elements that are tightly coupled, so changes affecting them are more likely to stay within the same package or module. section 4.2 section 4.2.2
Cohesion complements loose design-time coupling: cohesion groups related elements, while loose coupling reduces the likelihood that a change to one element requires changes to another. Apply both goals across the hierarchy, from methods and classes through packages, subdomains, and components. Some coupling is inevitable; the design task is to group and manage it. section 4.2.1
Figure 4.2 You can localize changes, which improves maintainability, by designing loosely coupled packages that are internally cohesive by virtue of being comprised of tightly coupled classes
The figure shows how tightly coupled classes can form cohesive packages that are loosely coupled to one another. section 4.2.1
Localizing a customer change
Order Management invokes the Customer Management API. If the subdomains are loosely design-time coupled, a Customer Management change is unlikely to require an Order Management change and might even be localized to one class. If they are tightly coupled, the change is more likely to spread, potentially requiring coordination between teams. section 4.2.2
Localized changes are easier and safer to make, improve team autonomy, and can avoid time-consuming changes across components. In a microservice architecture, grouping decisions also create process and transaction boundaries. A design that simplifies an operation may come at the expense of a less desirable service design, so evaluate the alternatives rather than treating cohesion as the only goal. section 5.2.2 section 7.5.3






