[Tutor] Global Variable Gotcha

Scott Widney SWidney@ci.las-vegas.nv.us
Wed Jun 25 14:20:02 2003


 
>   Ah! Here's that word again (coupling) :-) 
> 
>   I'm sure it has a pythonic context... Seriously Alan,
>   can you point me to any docs, articles, examples 
>   on this subject (coupling/decoupling) as per python? 
> 
>   I'm really in need of info to help improve on my 
>   design skills.

Loose coupling and strong cohesion are symmetric goals of software design.

Loose coupling is achieved by reducing interdependency. This can be applied
to functions, modules, classes, packages, etc. The more independent the
entity is, the looser the coupling will be to another like entity.

Strong cohesion refers to singularity of purpose. A function that does one
thing only has strong cohesion; a Swiss-Army-Knife function does not.

I read "Code Complete" from Microsoft Press a few years ago and it covered
the topic well in terms of structured design for procedural languages.

This site http://www.extensiblejava.com/jsp/intro.jsp has good explanations
in terms of object-oriented programming.


Scott