Re: creaping coupling......

From: Mark Nicholls (nicholls.mark_at_mtvne.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 16:41:14 -0000


"Robert C. Martin" <unclebob@objectmentor.com> wrote in message
news:g52t1158vejh1dk89uep1t9cotjk13jqhh@4ax.com...
> On Thu, 24 Feb 2005 21:22:01 GMT, "H. S. Lahman"
> <h.lahman@verizon.net> wrote:
>
> >It's not you. The basic problem you describe can be summarized as:
> >physical coupling. The OOPLs do a great job on minimizing logical
> >coupling between program units but they do a terrible job on physical
> >coupling.
>
> No. A statically typed OOPL does a better job at minimizing physical
> couplings than a statically typed non-OOPL. A dynamically typed OOPL
> (like smalltalk, phython, or Ruby) does a *tremendous* job of
> minimizing physical couplings. It reduces them to near zero.
>
> Even in statically typed OOPLS the problem is not that bad. With a
> good knowledge of OO design principles and design patterns, a designer
> can reduce physical coupling in C++, Java, and C# to very low levels.
> Indeed, *THAT* is the reason that OO language, and OO design
> principles and patterns, are beneficial to the software industry.
>

You need to demonstrate how to solve the following trivial problem, before I
will believe that claim.

interface IWriteable
{
    void Write(IElement element);
}

class CPipe : IWriteable
{
...
}

class CPipeWriter
{
   public CPipeWriter(IWriteable writeable)
   {
   ...
   }

   void WriteABC()
   {
       writeable.write(new Element("ABC"));
   }
   ...
}

client code

IWriteable pipe = new CPipe();
CPipeWriter writer = new CPipeWriter(pipe);
writer.WriteABC();

but my compiler insists this code needs to know what an IElement is because
it appears in a method in IWriteable......can someone show me how to get
around this? or is it endemic in all strongly typed languages....or am I
just talking nonsense.



Relevant Pages

  • Re: creaping coupling......
    ... A statically typed OOPL does a better job at minimizing physical ... Even in statically typed OOPLS the problem is not that bad. ... good knowledge of OO design principles and design patterns, ... can reduce physical coupling in C++, Java, and C# to very low levels. ...
    (comp.object)
  • Re: creaping coupling......
    ... It reduces them to near zero. ... dynamically bound OOPLs have less of a ... > good knowledge of OO design principles and design patterns, ... would be largely unnecessary if it weren't for the physical coupling. ...
    (comp.object)
  • Re: creaping coupling......
    ... The basic problem you describe can be summarized as: ... > The compiler needs to know how to build B and access it. ... > John Lakos has a good discussion of these sorts of physical coupling ... > typed OOPLs and, to a lesser extent, to dynamically typed OOPLs. ...
    (comp.object)
  • Re: creaping coupling......
    ... The compiler needs to know how to build B and access it. ... John Lakos has a good discussion of these sorts of physical coupling ... typed OOPLs and, to a lesser extent, to dynamically typed OOPLs. ... One can minimize it with dependency management. ...
    (comp.object)