Some people
feel that getting object-oriented programming (OO) is difficult and
time-consuming process. Many of the cornerstones of OO programming benefit
other programming paradigms as well. The article presents several types of
couplings, used in computer science, for the study of OO. Dynamic coupling
occurs when a piece of code uses another piece of code at runtime. This can get
seriously out of hand using a style called the "train wreck."
Temporal coupling appears when one has a dependency on time-either on things
that must occur in a certain order, at a certain time, by a certain time, or
worse, at the same time. Always plan on writing concurrent code because the
odds are good that it will end up that way anyhow, and one can get a better
design as a fringe benefit. Domain coupling takes place when business rules and
policies become embedded in code. Again, that's not necessarily a bad thing
unless mirroring real-world changes becomes difficult. If the real world is
particularly volatile, put the business rules in metadata, either in a database
or property files. Even in OO systems, view an object's behavioral interface as
a set of function calls. That's really not a helpful metaphor. Instead of
calling software a function, view it as sending a message.