Subject: Re: CCL: CCL:Object-oriented means for computational chemist

From: Zhou Feng <[email-masked]>
Date: Thu, 24 Jul 1997 09:36:24 -0500

Ping Du wrote:
> 
> Hi,
> 
> I found the discussions on OO programming very useful!  However,
> there is a point that I would like to bring up.  That is, is it
> possible to implement an OO design using a non-OO language?  The main
> design features of OOD are abstraction, encapsulation, and
> inheritance.  One may achieve abstraction and encapsulation in a
> non-OO language by forcing discipline. 

A perfect example of enforcing OO-like methodology in non-OO language
would be Visual Basic,  in fact it not only gave the appearance of
OO but also has a GUI tightly coupled to the commonly used objects. 
However there seems to be a couple of important thing missing for
this type of language,  one important feature would be the data
encapsulation capability, i.e.,  you can still manipulate variables of
other classes in a different class.  In C++ for example, you can declare
those variables as private and avoid such mess in data manipulation.  
It is certainly an important feature for bussiness type development
to avoid security loopholes and undesired programming tricks, I don't
know whether it is that important for computational scientist (maybe 
for the compute objects and the type of programming Andrew Dalke
mentioned).   However, it would be quite a pain to do thing in the
object oriented way without the help of the language itself and the
compiler, just imagine the book keeping and debugging.

Feng Zhou
Argonne National Lab.

---

From: "David E. Bernholdt" <[email-masked]>
Date: Wed, 23 Jul 1997 18:08:13 -0400

On Tue, 22 Jul 1997 07:45:08 +0000  "Ping Du" wrote:
> Inheritance is pobably the most important feature of 
> OO design if you would like your program to be extensible and 
> reusable.

I don't entirely agree.  Having done OO _design_ and implemented those
designs in "non-OO" languages, I believe that the other principles of
OO design (abstraction, encapsulation, modularity) are probably more
important and more powerful.  I have not encountered a case where I
felt at a serious disadvantage because the languages I was using did
not support inheritance.

But in any case, I must stress the importance of design.  Looking
back, I think that a thorough design phase probably allowed us to find
the right abstractions so that inheritance was really not an issue,
and we could do what inheritance was required "manually".  It also may
be a property of the problem to some extent (in our case a broad
spectrum of electronic structure methods).
--
David E. Bernholdt                      | Email:  [email-masked]
Northeast Parallel Architectures Center | Phone:  +1 315 443 3857
111 College Place, Syracuse University  | Fax:    +1 315 443 1973
Syracuse, NY 13244-4100                 | URL:    http://www.npac.syr.edu