Skip to main content

Posts

Showing posts from December, 2014

Coupling / Cohesion

There was a question asked on the 97 Things Every Software Architect Should Know Linkedin group about coupling and cohesion  that got me thinking. My first response was to point to the video by  +J. B. Rainsberger :  Understanding Coupling and Cohesion . But this video didn't satisfactorily coupling and cohesion question. As a follow up, heres what I wrote on the group, to solidify my understanding of coupling and cohesion, since it's not a topic that comes up directly during development. Let me describe how I view coupling / cohesion, and see how it lines up with your understanding.    For me, coupling is the ease of which you can pull modules apart. You notice this when moving classes and functions around during refactoring. Until you make a change, you don't really feel the pain of tight coupling. To minimize this pain, you remove needless dependencies, depend on abstractions instead of concrete classes, pay attention to the law of demeter, etc (i.e. use good