Polymorphism Downsides (was: what's the future of Object Oriented Programming)



Phlip wrote:
Bruno Desthuilliers wrote:

Haven't you read Design Patterns?

Yes, I have. But this debate is about advantages and disadvantages of
polymorphism. Not about different design patterns.

I clearly see how polymorphism can help, but I fail to see what the
"disadvantages" of polymorphism could be (unless you count "doesn't solve
my actual problem" as a "disadvantage").

I have a list of potential down-falls of polymorphism on my website.
However, I can sum most of them up with one sentence: Polymorphism does
not easily lend it itself to SET THEORY.

I often find it easier to describe an instance or variation on a theme
as sets or a set expression. Polymorphism seems fundimentally against
this. At least it does not naturally help it.

After exploration, you will eventually have to agree that it is better
to model something like an Employee using sets rather than
polymorphism. Polymorphism is simply too limiting. Sure, you can use it
to make strategy patterns etc. that are a kind of set engine, but there
are usually more convenient ways to get the same thing without OO,
especially if you want to query the set info.


I tend to ask "Have you read /Design Patterns/" as short-hand for "Have you
seen examples of OO techniques being used correctly, to simplify programs?"


Like I said elsewhere, the Design Patterns books is geared toward
systems software. It's lessons so far appear not applicable to other
domains, such as custom business software. I do not question OO's
abilities for systems software, but that is not my domain.

-T-

.



Relevant Pages

  • Re: Is OO a tradeable commodity/skill?
    ... expect you to be familiar with polymorphism, design patterns, etc. ... One great way to nose-dive an interview is display technical incompetence ...
    (comp.object)
  • Re: Always avoid "new"
    ... Robert Tisdale" wrote: ... >> polymorphism and design patterns such as Abstract Factory. ... The usual worthless Trollsdale opinion. ...
    (comp.lang.cpp)
  • Re: Always avoid "new"
    ... >> polymorphism and design patterns such as Abstract Factory. ... An Abstract Factory makes perfect sense, ... pointer) but when these issues are avoided AF is the best ...
    (comp.lang.cpp)
  • Re: Polymorphism Downsides
    ... Not about different design patterns. ... "disadvantages" of polymorphism could be (unless you count "doesn't solve ... as sets or a set expression. ...
    (comp.object)
  • Re: Polymorphism Downsides
    ... Dmitry A. Kazakov wrote: ... "disadvantages" of polymorphism could be (unless you count "doesn't solve ...
    (comp.object)