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: a07f3367d7,e276c1ed16429c03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada is getting more popular! Date: Sun, 31 Oct 2010 15:57:21 +0200 Organization: Tidorum Ltd Message-ID: <8j5au1Fm4hU1@mid.individual.net> References: <8732ea65-1c69-4160-9792-698c5a2e8615@g13g2000yqj.googlegroups.com> <4cc60705$0$23764$14726298@news.sunsite.dk> <4cc6753c$0$23756$14726298@news.sunsite.dk> <4cc71e08$0$23758$14726298@news.sunsite.dk> <4cc87d7a$0$23755$14726298@news.sunsite.dk> <4cc912e1$0$23761$14726298@news.sunsite.dk> <10g3vmx6lxyu.bjfg1i5gjcsf$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net BbJsEMr4LXaLElP6YUxcbQDg3g1OQyYRDnx4I4kuzGtr0PIhUv Cancel-Lock: sha1:24fuqpK52Xp/y6/AOBdSG/Vwo1Q= User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) In-Reply-To: <10g3vmx6lxyu.bjfg1i5gjcsf$.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:16013 Date: 2010-10-31T15:57:21+02:00 List-Id: Dmitry A. Kazakov wrote: > On Sun, 31 Oct 2010 11:38:02 +0100, J-P. Rosen wrote: > >> FWIW, here are my criteria for using inheritance: >> 1) you have several types, that are too different to be modelled as >> variations of a single type (use discriminated types otherwise); >> 2) however, these types have some common logical properties, with >> different implementations >> 3) you have to maintain an heterogenous container of these various types >> 4) you want to call the common operations on all objects in the container > > 5) you want to postpone some design decision/implementation to a later > point. So you describe/implement what you know for certain right now, in > the form of an abstract type, and let a derived type to define the rest > when more information becomes available. I have a similar criterion with a different interpretation of "later point", assuming that Dmitry's "later" means "later in time". My criterion is: 5') you want to declare the existence and common properties of these types relatively early in the package dependency graph, with the minimal set of dependencies, but postpone implementations to a deeper point (ie. a "later point") in the dependency graph. In my designs this aspect of inheritance and extension has greatly helped to decouple packages. However, I believe that Jean-Paul's four criteria 1-4 have also been satisfied, so 5' is perhaps rather an effect or benefit of using extension and inheritance than an independent criterion. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .