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,999932ecc319322a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail From: spambox@volja.net Newsgroups: comp.lang.ada Subject: Re: advice on package design Date: 8 Mar 2005 04:48:41 -0800 Organization: http://groups.google.com Message-ID: <1110286121.068133.82160@l41g2000cwc.googlegroups.com> References: <1110212638.336123.298580@l41g2000cwc.googlegroups.com> <1gbk0qx2sgzpg$.sltzfssofla8$.dlg@40tude.net> NNTP-Posting-Host: 82.192.62.228 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1110286125 31577 127.0.0.1 (8 Mar 2005 12:48:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Mar 2005 12:48:45 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: l41g2000cwc.googlegroups.com; posting-host=82.192.62.228; posting-account=sjoIww0AAACsQsohcnPenkRLTMgYA84g Xref: g2news1.google.com comp.lang.ada:8851 Date: 2005-03-08T04:48:41-08:00 List-Id: Dmitry A. Kazakov wrote: > There are many different ways to deal with that. If you have Dmitry, thank you very much for you help; this is the second time that you've posted elaborate answers to my problems. I apreciate it. > 2. You can instantiate your Baz outside Foo but with the things defined in > the public part of Foo: > Note that the body of Foo may still use Baz: My thoughts on this solution: the package would have to know how the user chose to instantiate another package, so that it could use the same name. On the other hand, let's say the package came with instructions as to how the package it depends on should be instantiated. However, that would leave the user no choice for the name and effectively we would get something similar to your first solution. I find this approach better; the package `a' comes with instructions, directing the user to "use" something that was instantiated in `a' with the same name, of course. Sure, it could also be renamed later. > 2.a. If Bar needs privates of Foo, the you can make Bar a generic child of > Foo. I have yet to investigate this one. > 3. You can rename parts of contents of Baz in Foo: At present, this is the accepted solution. It seems to me that it's also the most logical for ada? Since we're forced to follow the rules of strong typing, then it's only logical to have different subroutines for each type. There are only less than ten subroutines in my linked lists package, so renaming then was easy. Besides, the program becomes clearer (in the end, that's what ada encourages us to do, right?) -- now, for example, we can use a word_walk subroutine for word lists, and eg. node_walk for all the others. Agreed, a good idea. andrej -- http://sonet.homelinux.net