From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!aioe.org!epJzlJsZWlp1WuFmYLlBpQ.user.46.165.242.91.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: on Ada abtract data type vs. OOP. Date: Fri, 9 Sep 2022 17:21:43 +0200 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="56015"; posting-host="epJzlJsZWlp1WuFmYLlBpQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:64305 List-Id: On 2022-09-09 16:37, antispam@math.uni.wroc.pl wrote: > Your statement is _very_ misleading. OO has many common aspects > with ADT, but there is substantial difference. I didn't say ADT is OO. I said OO is ADT. Clearly OO deals with abstract data types [and classes of]. [ Here abstract means: user-defined, an problem space abstraction, rather than Ada's abstract type in the meaning: a type with no instances. ] > In more formal terms OO is mainy about > _dynamic_ subtyping. (dynamic polymorphism, actually) OO is about of having classes of types in a way that the closure of that class would be a proper type again. In Ada terms: 1. T, some tagged type 2. Class = all types derived from T and T itself 3. [Derivation] closure type = T'Class Ad-hoc polymorphism (overloading) and parametric polymorphism (generics) produce classes with no type for the closure. E.g. you have no type for all instances of all types having procedure Put (File : File_Type; Value : ); -- ad-hoc class [... parametric polymorphism example skipped ...] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de