From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b8748382fcfacc1 X-Google-Attributes: gid103376,public From: Ray Blaak Subject: Re: friend classes in ada95 Date: 2000/04/20 Message-ID: #1/1 X-Deja-AN: 613639166 Sender: blaak@LANGLEY References: <8dh37m$qef$2@wanadoo.fr> <3B5L4.1317$B43.116109@news.pacbell.net> <38FD1830.949F5E81@mindspring.com> <38FD1C9E.7C2B7756@research.canon.com.au> <8dldqi$mb7$1@nnrp1.deja.com> <38FE365D.31C893A6@acm.org> <8dmjsq$vm9$1@nnrp1.deja.com> X-Complaints-To: news@bctel.net X-Trace: news.bc.tac.net 956248126 209.53.149.68 (Thu, 20 Apr 2000 09:28:46 PDT) Organization: The Transcend NNTP-Posting-Date: Thu, 20 Apr 2000 09:28:46 PDT Newsgroups: comp.lang.ada Date: 2000-04-20T00:00:00+00:00 List-Id: Robert Dewar writes: > In article , > Ray Blaak wrote: > > OO programming being essentially about ADTs covers the most > > important and worthwhile point. What makes OO programming > > different from ADTs, in least in my opinion, is language > > support for inheritance and polymorphism. > > nope! that has nothing to do with object oriented programming. Well, "nothing to do" is a little strong. All of the OO languages give exactly these features, and saying a language is an "Object-Oriented" language has some meaning precisely because of this fact. > Example. Suppose we define an abstract algebra as a tagged > type. The operations are purely value oriented (e.g. operation > + on two elements computes a third element). I am perfectly comfortable with calling this OO. > What does not make sense is to think of this as object > oriented programming, since the two fundamental components > of objects: > > 1. state, so that objects can be changed Are you saying that only mutable things can be considered as objects? That seems extreme to me. > 2. methods with message passing semantics so that the > operations are viewed as passing a message to the > distinguished object (the prefix in languages that > use this syntax) I think I agree with this one (that it is fundamental to OO), although I point out that there does not have to be a single distinguished object (e.g. Common Lisp's object system works in general with multiple distinguished objects). The important thing is the conceptualization of the problem into a collection of entities that are responsible for doing things to themselves and each other. > are completely missing. I would assert that your example actually has both of the characteristics. With regards to state, even if there is no specifically modelled state, one still has object identity in relation to other objects (e.g. A+B is (often) different from both A and B). With regards to message semantics, the "+" operator would presumably be implemented by doing some sort of evaluation of its arguments, "asking" them questions about themselves ("who are you?" at the very least). > If you think that OO is simply about ADT's then you are back > in the 60's and have missed something :-) > > On the other hand, if you think that type extension, information > hiding, and dynamic dispatching are ONLY about object oriented > programming, then you have also missed something! It's a matter of semantics. "Object-Oriented" as a term tends to be fairly vague, which is why we have threads like this. I like programming by conceptualizing the problem in terms of "objects", and using type extension, information hiding and dynamic dispatching. I don't necessarily use all of these features simultaneously. I call it OO anyway. I don't think I am alone, but I am not that worried about it. The important thing for me is to make robust, well-designed and maintainable software. OO as a term is really only important to me during job interviews. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, blaak@infomatch.com The Rhythm has my soul.