Re: OO and Extending (Was: Is Procedural Paradigm a basis of OO Paradigm?)
- From: <adaworks@xxxxxxxxxxxxx>
- Date: Sun, 25 Mar 2007 18:02:09 -0800
"topmind" <topmind@xxxxxxxxxxxxxxxx> wrote in message
news:1174848412.482369.286550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The evidence is the many software systems, including business
adaworks@xxxxxxxxxxxxx wrote:
"topmind" <topmind@xxxxxxxxxxxxxxxx> wrote in message
The fact that something _can_ be done in a given manner
That greatly depends on the language.
does not mean it _should_ be done that way.
Everybody on the web claims or implies they are Einstein's superior.
You have to *show* OOP being better, not merely claim you are smart
and experienced. Use code and realistic change scenarios applied to
it, for example. If you don't want to do it, then just say so. We
don't need yet more unverifiable anecdotes, they are a cheap commodity
on the web, to be frank. People come to see evidence, not read resumes
from people who have very positive views of themselves.
data processing systems that have been developed successfully
using OOP. Of course, there are also a lot of such systems
where OOP was used badly.
I think I mentioned Eiffel as a good model for doing OOP right. In
I find at least two problems with OO's approach to "extension without
modification".
The first is that most changes in the real world are *not* tree-
shaped. Overriding subtypes generally assumes a tree-shaped extension
pattern. (OO does not have to use trees, but it is far messier than
the competition, at least not better, when it does such.) I find sets
a better way to manage variations/features than trees and believe this
to be an inharent advantage of sets. They are far more flexible and
don't force you to commit to one dimension/factor being artificially
dominant. Trees may be okay in the short-term, but as more features
are piled on, they cannot handle it.
Eiffel, one is not restricted to the usual tree approach. Even so, levels
of abstraction do work well in real life. In Ada, a language that I
have found useful, the object model is augmented with a feature of
child library units that are a lightweight form of programming by
extension that does not require the standard model of inheritance.
Object components are not restricted to tree structures. And, message
passing via delegation does not depend on inheritance. Another powerful
variation is genericity. While this is not found in every OOP language,
it is an essential feature of Eiffel, Ada, Java, and C++ (as templates). I
admit that the template model of C++, while quite powerful, is also
full of potential for making a horrid mess of things. But this same feature
in Eiffel and Ada is a stable and effective adjunct to the object model.
There are a lot of variations for design in OOP that go beyond
inheritance alone.
The second is granularity. Real-world changes often don't always fitOverriding, done correctly, does not require the code rework you
the grain of one's code granularity. Thus, in practice one has to do
things like figure out how to override one-third of a method. It can
be a lot of code-rework to do such. And IF statement is like a
calliper that can reach over any range in any part of the code, and
this is less subject to granularity problems and less code re-work.
(If there is a pattern to many of the IF statements, then often such
can be tablized to make it easier to see and manage.)
speak of. The principle is "open to extension but close to modification."
It works quite well in practice. It works for systems programming,
applications programming, and other kinds of programming. The one
exception, in my experience, is scientific programming where it seems
to have more limited application (limited is not the same as none).
Tables are a good technique for software development. I have used
I've pointed this out before, and don't remember you responding.
decision-table languages and I'm quite fond of the EVALUATE statement
in COBOL. I wish more languages had a statement similar to the
EVALUATE statement. I also use tables in other parts of my designs.
An IF statement, when doing extensible designs, requires one to revisit
existing implementation code, open it up (like cracking open a chest for
open-heart surgery), and modify it. This is not necessary in a correctly
designed OOP system. It violates the principle of "open to extension,
while closed to modification." I breaks the principles of information
hiding and encapsulation.
Further, an IF statement with the kind of global range you suggest is in
violation of the principles of coupling and cohesion. OOP has the
virtue of providing a stronger model of encapsulation, greater opportunity
for cohesion, and limiting the need for excessive coupling.
This statement, by itself, flies in the face of a reality that has existed
ADT are a nice concept on paper, but often just don't work in the real
world. They cannot handle reality very well.
since the early 1970's. It demonstrates a sad lack of understanding
of the central tenets of software development that have worked for
over thirty years. I recommed you read John Guttag's PhD dissertation
for a more comprehensive understanding of the concepts of data
and procedural abstraction.
Richard Riehle
.
- Follow-Ups:
- References:
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: Mark Nicholls
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- From: adaworks
- OO and Extending (Was: Is Procedural Paradigm a basis of OO Paradigm?)
- From: topmind
- Re: Is Procedural Paradigm a basis of OO Paradigm?
- Prev by Date: Re: Difference between Factory and Abstract Factory
- Next by Date: Re: OO and Extending (Was: Is Procedural Paradigm a basis of OO Paradigm?)
- Previous by thread: OO and Extending (Was: Is Procedural Paradigm a basis of OO Paradigm?)
- Next by thread: Re: OO and Extending (Was: Is Procedural Paradigm a basis of OO Paradigm?)
- Index(es):
Relevant Pages
|