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,47def5aa7b3182bd X-Google-Attributes: gid103376,public From: "Samuel T. Harris" Subject: Re: Question (was Re: How to write TYPECASE in Ada 95?) Date: 1999/02/24 Message-ID: <36D4130E.2D476D7A@hso.link.com>#1/1 X-Deja-AN: 447912115 Content-Transfer-Encoding: 7bit References: <79fct8$9k3$1@murdoch.acc.Virginia.EDU> <1103_918264881@DZOG-CHEN> <36cdb012.580716@news.pacbell.net> <7av52o$62g@news3.newsguy.com> <7avc0i$cnb$1@its.hooked.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Raytheon Training Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-24T00:00:00+00:00 List-Id: Mike Silva wrote: > > Samuel Mize wrote in message <7av52o$62g@news3.newsguy.com>... > <...> > >Remember, tagged types are NOT a facility for object-oriented > >programming. Together with other facilities in the language, they > >support that idiom. However, tagged types are a facility for > >programming by extension, in a much more general form than many > >object-oriented languages provide. > > This intrigues me greatly, but being an Ada neophyte and not having that > much OOP background in general I don't know what it means. Would anybody > care to offer an explanation, or point me in the direction of one. Thanks > much. > > Mike Silva One of the attractive attributes of Ada is that facilities are provided without attaching some taxonomy to the facility. Frequently, a combination of facilities are required to match a particular paradim. While this may appear to some as form of "weak" support for that paradim, I see it as freeing the language from the paradim du jour. I am free to combine language elements to suit the mind set at hand without fighting an ingrained taxonomy within the language itself. This also enables the language to keep the features orthogonal to each other. Because so many features and constructions are available, their use together many times calls for what appear to be archane rules to protect the system being developed. The protection is desirable, but the orthogonality of the constructions sometimes hides the necessity of some of the rules. If I was doing structured programming, I'd have a hard time getting past the taxonomy enforced by C++ and other OOLs. I don't have that problem with Ada. As Samuel Mize says, tagged types provided a mechanism for type extension. Since OOP relies upon type extension, tagged types are a natural match. Packages provide encapsulation and naming scope. Packages group things together. A OO class is a grouping of a data structure type and its defined operations. So a class must be a package defining a tagged type and including all the primative operations on that type. Both are required to implement a class. Singular inheritance is directly supported by the language through tagged types. Multiple inheritance, in several forms, is supported by combining tagged types with other language constructions such as generics. I believe Ada 95 Rational provides an in-depth discussion on kinds multiple inheritance, why they are not directly supported, and how achieve the desired result. I just wish Ada didn't use the term class-wide type. It is a term with too much overloaded meaning. Since you are an Ada neophyte, I recommand you visit www.adahome.com and browse around. You'll want to consider downloading the GNAT compiler for your personal use at home. You may also consider getting the Walnut Creek Ada CDROM which contains tons of code and supporting documents which are not just limited to Ada, but also include good software engineering as well. -- Samuel T. Harris, Principal Engineer Raytheon, Scientific and Technical Systems "If you can make it, We can fake it!"