??? 02/26/07 16:48 Read: times |
#133727 - Cohesion & Coupling Responding to: ???'s previous message |
Jan Waclawek said:
So, I am trying to fit a tool or a method to the problem, not the other way round. I don't know of a tool, but the method is to group related stuff together, and keep unrelated stuff separate. "Coupling" is a term for how "tightly" different modules are bound together; ideally, you want your modules loosely coupled with simple, well-defined interfaces. "Cohesion" is a term for what constitutes "related stuff" - I remember 3 types of Cohesion: Functional Cohesion - stuff that has related functions; thus you might get a UART module, an LCD module, a Keypad module, etc... Temporal Cohesion - stuff that happens at related times; eg, you might have a module with all the startup of initialisation stuff... Coincidental Cohesion - stuff that isn't really related at, other than by the fact that you happened to bundle it all together! |