javacouplingcohesion

Coupling/Cohesion


Whilst there are many good examples on this forum that contain examples of coupling and cohesion, I am struggling to apply it to my code fully. I can identify parts in my code that may need changing. Would any Java experts be able to take a look at my code and explain to me what aspects are good and bad. I don't mind changing it myself at all. It's just that many people seem to disagree with each other and I'm finding it hard to actually understand what principles to follow...


Solution

  • I can recommend Alan's and James's book Design Patterns explained -- A new perspective on object-oriented design (ISBN-13: 978-0321247148):

    Cover: Design Patterns explained -- A new perspective on object-oriented design

    It's a great book about has-a and is-a decissions, including cohesion and coupling in object-oriented design.