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,229ea0001655d6a2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Generic Package From: Georg Bauhaus In-Reply-To: <1177601484.444701.171560@r35g2000prh.googlegroups.com> References: <1177539306.952515.222940@s33g2000prh.googlegroups.com> <1177601484.444701.171560@r35g2000prh.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-Id: <1177603644.24583.15.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Thu, 26 Apr 2007 18:07:25 +0200 NNTP-Posting-Date: 26 Apr 2007 18:07:25 CEST NNTP-Posting-Host: 97fea517.newsspool1.arcor-online.net X-Trace: DXC=2[R7;TF05\BH3YBmZg13MPQ4OEA:ho7QcPOVCgiUa@TOl`dMhMhSIGZBoe@ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15311 Date: 2007-04-26T18:07:25+02:00 List-Id: On Thu, 2007-04-26 at 08:31 -0700, andrew.carroll@okstate.edu wrote: > I discovered a possble design mistake in the program I wrote for my > Master's course this semester. It's working and all that but I think > I could have saved myself many hours of work had I recognized (and > regurgitated from my undergraduate knowledge in 2002) the "is a" > concept. With respect to databases a tuple "is a" collection of > attributes and a table "is a" collection of tuples and a schema "is a" > collection of tables. I could have used a generic "collection" to > satisfy tuple, table and schema and I wouldn't have had to write code > to iterate, add, delete, etcetera from them. > > Does that help explain it? Are you certain that these high level "is a" relations aren't entirely artificial? What is gained by finding a thin, common interface of tuples, tables, and schemata? In the case you describe, I'd prefer composition over inheritance. A table has many tuples, and a table is part of a schema. So that alone makes tables collections of tuples, for example. By analogy, every type of a program identifies a collection of values. But not every type in a program must be explicitly derived from some universal ancestor, even when we could find some remote property that it shares with all other types. There is value in differentiating objects. Universal unification of everything leads to answers as useful as 42. :)