From: Phlip on 8 Jun 2005 09:37
Gerry Quinn wrote:
> > > To say "OO is about polymorphism", in short, is nonsense.
> > Definitions, in engineering, should be short, useful, and distinct. Long
> > rambling definitions don't help discussions.
> In the first sentence, you left out "correct".
Humans make engineering up to solve problems. Incorrect definitions would
not be useful.
From: topmind on 8 Jun 2005 17:55
> The bottom line for OO is that it is a technique for
> managing dependencies and reducing coupling; and
> the primary tool for achieving that is polymorphism.
And I invite you to demostrate that with code examples
outside of "device driver" examples. (Unless you can
argue that most software issues can be effectively
modeled as or like device drivers.)
From: Programmer Dude on 8 Jun 2005 18:12
Robert C. Martin writes:
> Polymorphism is a tool, not a solution. Topmind rails against the
> tool because there are cases where it doesn't work well. I, for one,
> am glad I have the tool.
Ditto. For example, I have a system that handles a variety of similar,
but not identical, XML messages. I find it an elegant solution to
have an abstract "XML Message" class with specializations handling
the specific message types.
Polymorphism is just a tool, not a way of life.
Even the GOTO has its place in the scheme of things.
From: Daniel Parker on 8 Jun 2005 23:51
"topmind" <topmind(a)technologist.com> wrote in message
>> The bottom line for OO is that it is a technique for
>> managing dependencies and reducing coupling; and
>> the primary tool for achieving that is polymorphism.
> And I invite you to demostrate that with code examples
> outside of "device driver" examples. (Unless you can
> argue that most software issues can be effectively
> modeled as or like device drivers.)
Lord knows, Uncle Bob may be guilty of many things, but failure to provide
code samples is not one of them. Why don't you pick one of the articles
from his web site, or take a fragment from one of his books, and tell us why
you think his approach is misguided?
From: Gerry Quinn on 9 Jun 2005 07:42
In article <cmqda1lgqhsfd2e40vdvkcvv3006uajfcd(a)4ax.com>,
> >Gerry Quinn wrote:
> >> To say "OO is about polymorphism", in short, is nonsense.
> This was cross posted to comp.object, so I'm not sure of the context.
> Taken on its own, the above statement is less than accurate.
The context was that is was a response to a poster who made the false
statement (and it was not qualified by context) that "OO is about
> OO has many defining traits such as encapsulation, inheritance, and
> polymorphism. However, the one trait that is present in all OO
> incarnations without modification is polymorphism. All the others are
> quite variable. For example, inheritance means very different things
> in different OO languages. In Smalltalk it's minor convenience,
> whereas in Java it is a critical necessity *because* it enables
> polymorphism. In C++ encapsulation boundaries are enforced by
> 'private' and 'protected' keywords. Other languages use those
> keywords in subtly different ways. Yet other languages don't have
> them, and don't enforce encapsulation.
To say "polymorphism is present in all OO incarnations without
modification" is merely to say that you have defined it more vaguely
than encapsulation and inheritance.
> The bottom line for OO is that it is a technique for managing
> dependencies and reducing coupling;
Yes, that is what it is for.
> and the primary tool for achieving
> that is polymorphism.
I don't agree with this, and even if you define polymorphism so
inclusively that it becomes true, it still doesn't justify the
assertion that that is what OO is about.
- Gerry Quinn