Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/11/08 22:02
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#156629 - Coincidental Cohesion
Responding to: ???'s previous message
Brett Wallace said:
Also, I'm not crazy about putting all my memory mapped variables in one header file either. Putting all variable definitions/declarations in their respective source/header files makes the code more modular.

When choosing things to group together into a "module", one should look at their "cohesion" - ie, what it is about them that suggests that they should be grouped together.

Two text-book examples are:

  • Temporal Cohesion - things that happen at the same time;

  • Functional Cohesion - things that are related to a common function

    To these, a lecturer I once heard added:

  • Coincidental Cohesion - things that are unrelated other than by the coincidence of being dumped into the same "module"

    I think that just sticking all your globals into "globals.h" is a prime example of Coincidental Cohesion...!

  • List of 13 messages in thread
    TopicAuthorDate
    Initializing variables in header files...            01/01/70 00:00      
       Defintions only in source files            01/01/70 00:00      
          Coincidental Cohesion            01/01/70 00:00      
             and yet...            01/01/70 00:00      
                Quite possibly            01/01/70 00:00      
                Memory mapping            01/01/70 00:00      
                   Now...            01/01/70 00:00      
                      RE: just saved myself some extra typing            01/01/70 00:00      
                Resources            01/01/70 00:00      
       Another problem            01/01/70 00:00      
       Abort, End, Exit Procudure and Shutdown.            01/01/70 00:00      
          I guess I gave it significant consideration            01/01/70 00:00      
          RE: verbose, over conditionalized            01/01/70 00:00      

    Back to Subject List