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,a270a1fc28d4f812 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-26 01:59:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!news2.euro.net!transit.news.xs4all.nl!not-for-mail From: Fraser Wilson Newsgroups: comp.lang.ada Subject: Re: OOD in Ada? Date: 26 Jun 2002 11:01:09 +0200 Organization: XS4ALL Internet BV Sender: fwilson@FWILSON Message-ID: References: <3d135676$0$8511$cc9e4d1f@news.dial.pipex.com> <3d1870b0$0$8507$cc9e4d1f@news.dial.pipex.com> NNTP-Posting-Host: a80-126-24-12.adsl.xs4all.nl X-Trace: news1.xs4all.nl 1025081974 28829 80.126.24.12 (26 Jun 2002 08:59:34 GMT) X-Complaints-To: abuse@xs4all.nl NNTP-Posting-Date: 26 Jun 2002 08:59:34 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:26709 Date: 2002-06-26T08:59:34+00:00 List-Id: "David Crocker" writes: > There is no way I want to put all the expression and statement classes in > one package! The natural way to construct the project is to put each class > in its own file (and hence package, if I am using Ada). Put just the abstract base classes for Expressions and Statements in the same package, and put derived classes in their own packages. You could use child packages for this. My compiler is structured along these lines: package Trees; -- abstract base class for tree node package Trees.Expressions; package Trees.Expressions.Operators; -- ... package Trees.Statements; package Trees.Statements.Ifs; -- enzofoort You get the idea. If it turned out that expressions and statements were mutually dependent, I would have either put them both in the same package, or have only the package bodies rely on each other (which you can do by casting down at run time -- not really recommended, but nevertheless useful). Fraser.