Object oriented programming

Don Gilbert gilbertd at sunflower.bio.indiana.edu
Wed Aug 19 15:57:57 EST 1992


This is a very off-the-cuff description of object oriented programming --
I hope someone else may provide a better one.

OOP is a bit like Darwin's theory of evolution applied to programming:
In the beginning, there was one simple object type, which doesn't know
much more than how to create and destroy itself.  New object types 
evolve from that ancestor object, by acquiring new methods (new ways
of interacting with other objects).  These decendent object retain 
all the methods of their ancestors, and can always use their
inherited methods with little effort.  That is one big advantage of
OOP over procedural programming -- inheritance of methods.

If an ancestor object is changed, all of its decendant objects change
also -- new features can be added very simply.  This is one of NeXT's
bragging points -- they added ability to use Kanji text to all existing
NeXT apps simply by teaching an ancestral text object about Kanji.

The power of OOP is most evident when you have a large object library
to build applications from -- you can more easily build new applications,
add new features, and add those features to many applications at once
if they rely on object libraries.  The programming I've been doing with
MacApp (Apple's OOP library for Macintoshes) shows that well to me.
I have three well-used programs, SeqApp, GopherApp and LoopDLoop, which
share many of the same underlying objects (where appropriate), and if
I enhance an object for one, it is fairly easy to get that enhancement
into another of the apps. 

I believe that in the coming several years, we are all going to be working
with object oriented operating systems, o-o applications, probably o-o
databases, etc.  The concept of ancestor-descendent objects, that carry
around their own methods for dealing with data, and that are extensible
thru subclassing, is a concept that saves programming time and makes for 
more robust and adaptable software.  It isn't the holy grail for 
programming, but OOP helps a lot in many ways.  If you are a programmer,
there is no good reason not to start working with OOP now -- you can get
good, inexpensive C++ compilers on all common platforms, and C++ lets you 
continue using procedural C mixed with object C as desired.  SmallTalk,
Object Pascal, and various other OOP languages are available, but C++ is
the most common and with the most OOP library support.

-- Don

-- 
Don Gilbert                                     gilbert at bio.indiana.edu
biocomputing office, biology dept., indiana univ., bloomington, in 47405




More information about the Bio-soft mailing list