Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Mass production, which in software terms is really widespread reuse as in DBI or HTML::Parser, always benefits from loose coupling--externally.

But one of the greatest benefits of loose coupling in the external interface of a module, is that it allows the internals to be very tightly coupled whilst concealing the complexity of the implementation from the user.

Graphics Adapters were originally very tightly coupled to their processors. The graphics on the Atari and Amiga PCs that were so revolutionary in their time, used highly customised chipsets that worked in tight syncronisation with their cpus, and made the generalised, loose-coupled adapters in IBM compatible PCs look positively clunky by comparison. Now, the loose coupling in the latter shines, because it allows the like of Nvidea et al to produce internally highly tuned, complex and powerful cards with their own on-board, specialist processors, whilst maintaining loose compatibility with anything that talks to them via that same clunky interface defined way back when.

The problem with designing for loose coupling, as with most things, is where to draw the line. OO-doctrine will require you to use abstract interfaces within a module and between subcomponents of that module, as well as at the external interface. In many cases, that is a step too far. The overhead costs of loose coupling internally, can mean that the benefits of a well defined external interface are never truely realised, because the module is too slow for real world applications.

The trade-off when designing for loose-coupling is:

How likely is the subcomponent behind that interface to be reused in it's own right, rather than as a component of the larger system?

If the answer is "Not very likely", then it may well be better to eshew the loose coupling at that level, in order to realise the benefits, usually performance, to the overall system, derivable from tight coupling internal subcomponents.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about question the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

In reply to Re: Loose vs. Tight Coupling by BrowserUk
in thread Loose vs. Tight Coupling by tlm

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (None)
    As of 2021-10-19 05:44 GMT
    Find Nodes?
      Voting Booth?
      My first memorable Perl project was:

      Results (76 votes). Check out past polls.