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 X-Google-Thread: 103376,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/08/04 Message-ID: <6q8utd$54o$1@platane.wanadoo.fr>#1/1 X-Deja-AN: 378073994 Content-Transfer-Encoding: 8bit References: <6pdhfo$1br$1@platane.wanadoo.fr><6pi71p$n90$1@platane.wanadoo.fr><6ppc3q$8ju$1@platane.wanadoo.fr> <6ps2ne$hko$1@platane.wanadoo.fr> <35C2E4C9.35441249@wanadoo.fr> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Adalog Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-08-04T00:00:00+00:00 List-Id: Matthew Heaney a �crit dans le message ... >Yes, the question might be "What naming convention do I use to effect >pure OO programming in Ada 95?" But maybe we should be asking ourselves >instead, "What is the simplest way to construct software systems using >Ada 95?" Obviously a different, but interesting one. > >If the system is modifiable and extensible, with minimal coupling among >the parts, then should we really care whether a "pure OO" approach was >used? Who even knows what "pure OO" means? FWIW, here is the criteria that I use when I decide to use an inheritance based mechanism. -1) I need a family of types that are different enough for not considering them as "variants" of a single type (in which case a discriminated type would be prefered), but still have enough commonalities for applying common operations to all of them, and -2) I need to maintain heterogenous data structures of these types, and I need to apply the operations regardless of the specific type. A typical example (not very original) is widgets: a menu cannot be considered a variant of a window or a button, however there is a "paint" operation that applies to all, and I may have to keep a list of displayed widgets to which I want to apply Paint. Another example is for making persistent objects, where I maintain a list of caches for various object types, and where I want to flush all caches to the data base when the program terminates.