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-7-bit X-Google-Thread: 103376,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/08/10 Message-ID: #1/1 X-Deja-AN: 379823388 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> <6q8utd$54o$1@platane.wanadoo.fr> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-08-10T00:00:00+00:00 List-Id: In article <6q8utd$54o$1@platane.wanadoo.fr> "Jean-Pierre Rosen" writes: > 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. I was going to say I add a third group, but it isn't really that, it is more of a closure. I mostly to use inheritance and mixins as a decomposition technique. In Ada 95, I can keep details of structures like lists and queues separate from the contents. This is why I lean towards closed coding and naming that is really targetted towards the user in the package spec, and the author elsewhere. But that is the BIG difference between the way inheritance is used in other languages and the way I believe it should be used in Ada. Used right in Ada 95, inheritance reduces coupling and increases cohesion. I can have a list of target records where the code for list abstraction is totally decoupled from the declaration and operations of the target abstraction and vice-versa. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...