Re: Disadvantages of Inheritance, Polymorphism and Encapsulation
From: Patrick May (pjm_at_spe.com)
Date: 27 Jan 2005 21:51:57 +0000
"topmind" <email@example.com> writes:
> I'll answer your question if you answer mine. Deal?
Strange. You made some claims about OO, with the clear
implication that you'd encountered the two problems of an OO approach
being less simple than an alternative and encapsulation "getting in
the way", but you seem extremely hesitant to provide the context in
which you found these to be the case. A description of the relevant
projects would enable your audience to better determine whether the
problems are inherent in the paradigm or if they are an artifact of a
> An example is having two sets of a bunch of objects (perhaps a
> collection of them) that I want to cross-reference. If this info
> was in a database, or similar collection-oriented system, I just
> simply perform a "Join" on the two sets. With objects one usually
> has to write explicit loops, create indexes (if long), etc.
This hypothetical lacks sufficient context for me to respond
meaningfully. If you can describe the types involved, the reason for
wanting to cross-reference them, the pertinent portion of the design,
and the problem being solved, I'll be more than happy to suggest a
> Objects don't automatically have these abilities
What abilities are you referring to?
> OO also tends to assume that each action or verb has
> one-and-only-one "proper" noun that it goes with.
That is not the case. Different languages make multiple dispatch
more or less difficult, but nothing in the approach imposes such a
> In the real world multiple nouns may participate and the players can
> change over time. This one-and-only-one approach is
> artificial. (Yes, it can be worked around by making a big mess, but
> I don't like big messes.)
Please describe a project in which you encountered a "big mess"
related to multiple dispatch? Which language was used? Why was
multiple dispatch required? Do you have an example of the code you
S P Engineering, Inc. | The experts in large scale distributed OO
| systems design and implementation.
firstname.lastname@example.org | (C++, Java, ObjectStore, Oracle, CORBA, UML)