Re: How Not to Design a Dog.



On Wed, 07 Mar 2007 14:28:48 +1300, John Carter
<john.carter@xxxxxxxxxx> wrote:

On Tue, 06 Mar 2007 10:43:40 -0800, Diego wrote:

On Mar 5, 11:44 am, "Nick Keighley" <nick_keighley_nos...@xxxxxxxxxxx>
wrote:

"If you asked Marconi's for a cat they'd send you a dog with a mod
kit."
Royal Navy Petty Officer

I am sorry, but I could not figure out what the hell are you talking...

I take it you work for Marconi then? :-)

Ok, so here is the long version of what I said, but being long, isn't
nearly as funny.

I'm riffing off the standard english "Tail wags the Dog" illustration of
control gone wrong to illuminate how "Big Balls of Mud" in software arise.

The correct answer in designing a Dog, of course, is the tail merely needs
to send an "Ouch!" signal to primary control object (brain) and there
after The Right Thing happens.

However a common anti-pattern in software is to implement requirements
starting from input event, and since creating new software couplings are
"free", to access the control elements directly from the inputs. ie. In
software, the "Tail" module can trivially access the leg control module
and the "Tail" developer can get himself bogged down trying to write a
"make legs run" routine.

In hardware and Canines connections (wires / nerves) are expensive so
there is a natural conservatism about creating additional coupling. In
software it's just another #include and a name reference so developers
will often gratuitously create additional coupling, since the cost of
doing so is borne in maintenance not development.

The correct solution is given by the OOD concepts of Single Responsibility
/ Data Ownership / Law of Demeter / Tell Don't Ask.

So now you know the full story, and next time you see someone hugely
violating the Law of Demeter you can briefly and pungently say, "Your tail
is trying to teach the Dog to run."

lol. Sometimes getting the tail to wag the dog can be all the
customer wanted (although a bit daft imho).

Being an OO person (and an odd one at that), my solution is to climb
over the fence and look at my own grass from the other side.

One realises that all mammals use the same design based on a central
nervous system, are warm blooded, have a backbone etc.

So for the OO approach I would simply create a mammal with a central
nervous system that has a set of pain receptors (input controls) and
emotional response unit (output control). The Dog part is merely just
a custom wrapper (UI) for that solution where the tail is connected to
the output control.

So I guess, its really a mammal with a dog mod kit applied :)

Ask for a dolphin and you'd likely get the same solution but with the
dolphin mod kit.


----------------
AndyW,
Mercenary Software Developer
.



Relevant Pages

  • Re: How Not to Design a Dog.
    ... control gone wrong to illuminate how "Big Balls of Mud" in software arise. ... the "Tail" module can trivially access the leg control module ... and the "Tail" developer can get himself bogged down trying to write a ... is trying to teach the Dog to run." ...
    (comp.object)
  • Re: education about equipment
    ... expending so much energy and passion defending e-collars here for years ... can control what drives them better than I could in field situations, ... hunting dog is a much superior mentor to a classroom. ... motivation and breaking down behaviors into components and chaining and ...
    (rec.pets.dogs.behavior)
  • Re: Pet Meds on-line
    ... And the worse thing is she has become an obnoxious guard dog. ... Our first lab we adopted from a family who was ... That dog would stand in the same place and wag her tail until we got in. ... >> Grr I've been trying to convince my doc I'm hypothyroid for years - now ...
    (sci.med.transcription)
  • Tail Docking, Dew Claws On Agenda In PA
    ... House Committee Holds Firm On ... Pennsylvania Tail Docking Ban ... Dewclaw Removal Added To Animal Cruelty Bill ... The American Sporting Dog Alliance ...
    (rec.hunting)
  • Re: Trip to Maryland
    ... urinary tract infection. ... We wrapped her tail, and while wringing ... Reka is the most beautiful Elkhound I've ever had. ... Reka is the dream dog of a lifetime for someone. ...
    (rec.pets.dogs.behavior)