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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7137ee7358078d09 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Basic Explaination of OO in Ada References: <1158593087.194781.250030@e3g2000cwe.googlegroups.com> <1158636734.971377.112550@d34g2000cwd.googlegroups.com> <1158674185.887102.205150@m73g2000cwd.googlegroups.com> In-Reply-To: <1158674185.887102.205150@m73g2000cwd.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <8GYPg.58703$aJ.31275@attbi_s21> NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1158698756 12.201.97.213 (Tue, 19 Sep 2006 20:45:56 GMT) NNTP-Posting-Date: Tue, 19 Sep 2006 20:45:56 GMT Date: Tue, 19 Sep 2006 20:45:56 GMT Xref: g2news2.google.com comp.lang.ada:6675 Date: 2006-09-19T20:45:56+00:00 List-Id: richard.charts@gmail.com wrote: > > So basically, OO is the principles: > polymorph, > encaps, > inheritance. > > And Programming by extension is the way to do it in Ada, as > class something: > { > } > would be in C++? No. OO is encapsulation of data and the operations on those data. In Ada 83, this was done through abstract state machines (package as object) or abstract data types ([limited] private type and corresponding operations). In assembler or C it's done through discipline. Programming by extension is the use of type extension (type X is new Tagged_Type with ...;), also called inheritance. Dispatching (also called polymorphism) can also be part of this, but in Ada, much of what would be dispatching calls in other languages are static. Ada also has package extension (child packages) as a form of programming by extension. -- Jeff Carter "You've got the brain of a four-year-old boy, and I bet he was glad to get rid of it." Horse Feathers 47