Polymorphism Downsides (was: what's the future of Object Oriented Programming)
- From: "topmind" <topmind@xxxxxxxxxxxxxxxx>
- Date: 18 Sep 2006 14:38:32 -0700
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-
.
- Follow-Ups:
- Re: Polymorphism Downsides (was: what's the future of Object Oriented Programming)
- From: Nick Malik [Microsoft]
- Re: Polymorphism Downsides
- From: Dmitry A. Kazakov
- Re: Polymorphism Downsides (was: what's the future of Object Oriented Programming)
- References:
- what's the future of Object Oriented Programming
- From: VV
- Re: what's the future of Object Oriented Programming
- From: H. S. Lahman
- Re: what's the future of Object Oriented Programming
- From: Bruno Desthuilliers
- Re: what's the future of Object Oriented Programming
- From: Phlip
- what's the future of Object Oriented Programming
- Prev by Date: Re: a modular design issue
- Next by Date: Re: what's the future of Object Oriented Programming
- Previous by thread: Re: what's the future of Object Oriented Programming
- Next by thread: Re: Polymorphism Downsides
- Index(es):
Relevant Pages
|