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,1dc0d0f1c69afb5a X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: polymophism Date: 1996/11/21 Message-ID: #1/1 X-Deja-AN: 197987381 references: <56q99a$5o3@rc1.vub.ac.be> <56skhq$9cg@hacgate2.hac.com> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-11-21T00:00:00+00:00 List-Id: In article <570f4b$rbu@queeg.apci.net> oconnor@apci.net (James O'Connor) writes: > I once posted here, a long time ago, that I don't think Ada95 was > an OO language. I received polite and informed rebuttals. I'll > say it again, for the same reasons, and expect the same response > so now hard feelings to anyone around... First? of probably many polite informed rebuttals. ;-) > The reason I object to Ada being called OO is that I don't think > Ada has an entity, thing, whatever that you can point to and say > "that's an object". Before you get into whether Polymorphism or > Inheritance (single or multiple, implementation or interface), I > think your first question should be 'can I create an object?'. To > me, at least, an Object must be able to have two things, state and > behavior (data and operations). If you want to define an OO-language as one which has stateful objects, and associated operations on the object, you should have no objection to Ada 83 and 95 as OO languages. The problem you have is one of seeing the forrest for the trees. In Ada the fundamental abstraction is named "type." Every object has a type, but as you are aware, there is no single set of operatations associated with a type. But this is only because, operations are associated with the view of a type, to allow things in Ada that are not allowed in many other OO languages. But most of those differences come up extremely rarely. The one that does often show up is the two (main) different views of a private type. Most of the time the model that works extremely well in Ada is that a type defines a set of objects, and a set of operations. (A class wide type contains all the objects in the hierarchy rooted at the base type, and the operations of the base type.) Even limited private types have some associated operations defined at the point of declaration, and derived types, which are common in OO programming have lots of implicitly declared operations. Now it is true that in Ada it CAN be harder to determine the set of predefined operations for a type in than in C++. However, when programs get large, it is much EASIER to determine the set of predefined operations in Ada 95 than in C++. (This occurs because Ada class hierarchies are typically bushier than in other OO languages--not as high/deep, but with more branches at each level. Types that are easily defined as siblings in Ada are often defined as parent and child in C++ or Smalltalk.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...