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,bf5045b7cee3d4b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!news.germany.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: tagged type as generic parameter Date: Thu, 03 Jan 2008 18:47:12 +0100 Organization: Adalog Message-ID: <837jlf.9p9.ln@hunter.axlog.fr> References: <602e79cf-755f-4600-a2cd-0cabf781136a@e25g2000prg.googlegroups.com> <17k6uddmxknzi$.1q1crpca0ygrf.dlg@40tude.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1199382592 8905 195.25.228.57 (3 Jan 2008 17:49:52 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 3 Jan 2008 17:49:52 +0000 (UTC) User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: <17k6uddmxknzi$.1q1crpca0ygrf.dlg@40tude.net> Xref: g2news1.google.com comp.lang.ada:19179 Date: 2008-01-03T18:47:12+01:00 List-Id: Dmitry A. Kazakov a �crit : > However, these are certainly not the case for the OP's code. Because Item > is private there and Data is constrained. And even if Item were visible, > then the right way would likely be #2, because "anything tagged" as in OP's > code does not tell much about the inherited semantics of list elements. > > IMO, your understanding of OOP is quite right. > Yeap. In these times where everybody is talking about OOP, people tend to move from "everything can be done with inheritance" to "everything must be done with inheritance". To be honnest, some languages offer inheritance as the only way, so there is no choice. When you are lucky enough to have a language that supports multiple paradigms, composition has its value. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr