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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,990196a3d5e5eb5e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-09 01:29:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!207.115.63.138!newscon04.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Child packages question References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 64.175.242.172 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1018340912 ST000 64.175.242.172 (Tue, 09 Apr 2002 04:28:32 EDT) NNTP-Posting-Date: Tue, 09 Apr 2002 04:28:32 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: F[O[SX[DGJVOBFD[LZKJOPHAWB\^PBQLGPQRZQMIWIWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Date: Tue, 09 Apr 2002 08:28:32 GMT Xref: archiver1.google.com comp.lang.ada:22264 Date: 2002-04-09T08:28:32+00:00 List-Id: >We put all of the bindings in Claw into private packages >(Claw.Low_Level.Windows, Claw.Low_Level.GDI, etc.). Only Claw can with >those packages; users of Claw can't access them. But parent's normally don't call children. In the Claw case, Claw.child may call claw.low_level.xxx but that's calling a cousin. I'd say the use of child packages for private packages is a less common technique. More commonly a child package extends somehow its parent. For instance, claw.sockets has a bunch of stuff, but claw.sockets.non-blocking has extensions for those times you want your sockets to be non-blocking. It can't be claw.sockets_non_blocking, "with"ing claw.sockets, because it needs access to some things that the parent claw.sockets does not make public. So usually children see parents, in more detail than the general public, but parents don't see children. The phraseology of parent/child/private parts etc just doesn't work nicely, at least if you are thinking of humans. Perhaps there's a nicer animal model. If you want Car to see Car.Engine, you probably want Car.Engine to be a package *inside* of Car, not a child of Car. Then the two packages can see (selectively) parts of each other.