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,c4f3d9c0fed1bd8f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 12 Dec 2005 16:13:09 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <439dc83c$0$27888$9b4e6d93@newsread4.arcor-online.net> Subject: Re: Classes and packages - recommended practice Date: Mon, 12 Dec 2005 16:17:29 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-BhPQRwZ7tFAtDk1+g6mBmctNJ/UHL+7GfpbBdX9glSVvCa2tIJL0QaGJar9K/pJb2Ly7uhAlGk7v8sX!owOmGfbUZtXJXaTedJh7GQcY7dTGIUIKWL3tjxUIEg03zwPbHgJ9DWOvZJN3ZpVamiQ8YNP7yG6v!edpRGytee+qiag== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:6855 Date: 2005-12-12T16:17:29-06:00 List-Id: "Georg Bauhaus" wrote in message news:439dc83c$0$27888$9b4e6d93@newsread4.arcor-online.net... > Maciej Sobczak wrote: > > with Shapes; > > use Shapes; > [lots more] > > > My question is - when do you use which form? > > I'll rarely use all types from all packages in the same place when > possible, because I want to leave that to the dispatching mechanism. :-) > So this is not the most frequent case. Right. In fact, it should never happen (because it creates a point where maintenance is a problem; you won't get an error if you omit one of the classes), unless you have very few classes. Generally, you only use the root type (for dispatching) and a couple of the leaf classes. Anyway, to answer your original question, I generally use a flat set of packages (because it is less likely to have unintentionally dependencies). But there is one important exception: if the child classes need access to details of the root classes implementation. In that case, the interesting stuff gets put into the private part of the root class, and the child packages can see it, but none of the clients can see it and mess up the abstraction with inappropriate operations. That is, I choose the flattest structure that is consistent with what needs to be hidden from the clients. Randy.