Skip to main content

Posts

Showing posts with the label coupling

Coupling and cohesion

I was reading ploeh's blog  this morning and it made me think about coupling and cohesion in general. These are import concepts in software development, Wikipedia has great definitions for both here & here . These are often contrasted together but they are different concepts and just because you have low coupling doesn't mean you'll have high cohesion. Using a car analogy the headlight unit for my Audi has tight (high) coupling because it's designed only to be fitted to a particular version. You could say it has high cohesion because it is part of a greater system to show light when a button is turned\clicked.... Taking another part of the car the tyre, the actual type of tyre will have low coupling to my Audi because it would suitable for several different models and makes, it would also have low coupling to the wheel, it has to fit a particular size but it could fit many wheels of this size. The tyre would still have high coh...