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: a07f3367d7,c6567772e9f3871d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!ff5g2000vbb.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: organizing deep source trees with child packages Date: Thu, 13 Oct 2011 07:18:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7179717a-9837-476c-b564-6599a9c02acd@ff5g2000vbb.googlegroups.com> References: <21c9e6bb-f4f7-4a00-bde7-68f2c1a42d01@q13g2000vby.googlegroups.com> <82ty7d1ewz.fsf@stephe-leake.org> <3486b228-abdd-490f-b4ef-9ee6b19f65fa@gy7g2000vbb.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1318517540 27711 127.0.0.1 (13 Oct 2011 14:52:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 13 Oct 2011 14:52:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: ff5g2000vbb.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-Via: ICAP/1.0 192.168.152.6 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCVNK X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Red Hat/3.6-2.el5 Firefox/3.6.13,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:21414 Date: 2011-10-13T07:18:27-07:00 List-Id: Greg Moncreaff wrote on comp.lang.ada: > 100's of files? =A0unless it was auto generated from a domain model, > how can you possibly keep it organized as to what depends on what, > what is separable, reusable; what deals with one interface/component/ > peer vs another, > etc Remember that Ada was designed for large-scale software engineering and therefore provides tools to: - encode dependencies, this is what "with" clauses are for. - minimize dependencies by means of information hiding. Private child packages are your friends. You normally design large modules as hierarchies of packages; the top-level package provides the public interface for the module and the private children provide the implementation. - keep track of dependencies: this is what gnatmake is for. - build and maintain cross-references: that's (also) what the .ali files produced by the compiler are for, and gnatfind is your friend. Directories are *not* a solution for these problems. They do not represent dependencies or hide any information from the compiler. They do not help navigate the sources; specialized tools like gnatfind, GPS or Emacs ada-mode do a better job with or without directories, and general tools like grep work better without directories. The one situation where I find directories useful is when I want to build some of my sources as a shared library. In this case I place these sources into a separate directory, build them separately, and then install the shared library along with sources, .ali files and a project file in a read-only directory where the rest of the software looks for them. This only works well if the shared library is mature and stable (i.e. does not change very often anymore). BTW, I too work on large-scale software (over 2 million lines of sources) where directories normally contain hundreds of source files. -- Ludovic Brenta.