7

High Cohesion, Loose Coupling

 2 years ago
source link: https://kevinsmith.io/high-cohesion-loose-coupling/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
In it for the long haul

High Cohesion, Loose Coupling

Kevin Smith · Sep 21, 2021 @ 10:03pm CDT

High-quality software is both valuable to the business and easy to change. While it’s simple to be dogmatic at either end of this spectrum, both goals are important to the business in the long run. Aiming for highly cohesive and loosely coupled code is key to finding the balance, but this concept can be tough to understand at first glance. So what does it actually mean?

High Cohesion, Loose Coupling characterizes software designed with a keen focus on Separation of Concerns, the foundation of effective, resilient, malleable, performant, secure, maintainable software.

High Cohesion describes the internals of a well-bounded module that consists of closely associated elements working together to accomplish one job, which helps maximize the comprehensibility of the codebase at large. Such a module contains all the decision-making power necessary to do its job.

Loose Coupling refers to minimal dependencies between modules, accomplished through strict, narrow, stable interfaces at the boundaries.

It's worth noting that a module is merely a distinct part of the system that performs some kind of important job and hides its inner workings from the rest of the system, according to David L. Parnas in his seminal paper on software modularization.

There are small-scale jobs and large-scale jobs, so this characterization of high-quality code applies equally to the system at every scale, from the smallest function to the entire application and beyond.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK