Qualities Patterns Share: Proper Coupling

Coupling can be said to exist when one part of a system is impacted by changes to another part. Where there is too much of this, changes to a system can be difficult, time consuming, and potentially destructive.

That said, coupling is also necessary. When objects collaborate with each other then they must interact, and this always creates some form of coupling among them.

Given that coupling is both needed and can be problematic, this means that there is both good and bad coupling in a system.

“Loose” is the term most people use when they think the coupling is the way it should be. I prefer the term “intentional” because it means the coupling was created on purpose to achieve a goal, and will therefore make sense and be expected to exist. Developers are smart; they never intend bad or excessive coupling.

“Tight” is the term people use to describe poor or excessive coupling, but I prefer the term “accidental.” The coupling we don't want is the coupling we never intended in the first place, but we sometimes make mistakes. When we discover coupling that exists but serves no defined purpose, then we seek to find a way to eliminate it.

Here, again, the patterns will help us. All the coupling in every pattern is there for a defined reason, is logical and meaningful, and is therefore intentional.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset