comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: organizing deep source trees with child packages
Date: Fri, 14 Oct 2011 07:55:52 -0400
Date: 2011-10-14T07:55:52-04:00	[thread overview]
Message-ID: <8239evkcs7.fsf@stephe-leake.org> (raw)
In-Reply-To: 3486b228-abdd-490f-b4ef-9ee6b19f65fa@gy7g2000vbb.googlegroups.com

Greg Moncreaff <moncreg@gmail.com> writes:

> On Oct 13, 4:20 am, Stephen Leake <stephen_le...@stephe-leake.org>
> wrote:
>>
>> Drop the directory tree; use a flat directory with full file names:
>>
>>
>> In my view, directories are for very large groupings of files; I often
>> have hundreds of Ada files in one directory.
>>
>
> In this case the files have coherence at the leaf level (same
> functional group, standard)
> but the middle levels will change (new adds, old removes)
>
> 100's of files?  unless it was auto generated from a domain model,

No, all hand-written over several years.

> how can you possibly keep it organized as to what depends on what,

That's what "with" is for; the file names don't indicate that (and
therefore your directory names don't either).

> what is separable, 

I'm not clear what you mean my "separable". In one sense, every Ada file
is already "separate".

'with' indicates everything needed for successful compilation, and
therefore for successful operation.

> reusable;

There are some directories, just not nearly as many as you have. My GDS
project looks like this:

sal; reusable
    math and data structures

opentoken; reusable

common ; reusable
    base
        core infrastructure
    models
        standard modules
    hardware
        interfacing to real hardware (analog IO, digital IO)
    1553
        modules that send packets over 1553
    spacewire
        modules that send packets over spacewire

mission; mission specific combinations of sal, common
    
80% of the code is in sal, opentoken, common.

each directory has a 'test' subdirectory.

> what deals with one interface/component/ peer vs another,

The file names don't really do that; how do you tell that
gds-models-reaction_wheel-adcole needs to interface to
gds-hardware-analog_out, but gds-models-reaction_wheel-gsfc needs to
interface to gds-hardware-1553?

In GDS, that information is implicit in the types of the input/output
symbols declared by the modules (these are _not_ just Ada parameter
lists, but items in a runtime symbol table). It is also stated in the
GDS user guide.

Repeating the file name in the directory name doesn't add any
information. So how do you do this?

The high level directory grouping is useful. Although if I was starting
over, I'd move the 1553 and spacewire directories into the hardware
directory; there's really no need to keep them separate. They were
separate in the first place because I was not sure how complicated they
would be when first starting on them, and because the tests were
structured differently than the other hardware tests. But that
difference has become less over time, as I've refactored things.


Give me a specific example; when is repeating the file name in the
directory name useful? 

What operation is possible/much more efficient on a directory with only
a few files than on a directory with lots of files?

Searching is easier in a flat directory; to find all of the files that
mention "serial", I can just do 'grep' in the common/hardware directory.
With your convention, I'd have to do 'find | grep'. Not a huge deal,
but not necessary, either. Sometimes I have to do find | grep as well,
since I do have some directories.

Organizing the tests is simpler in flat directories; it's much easier to
tell that you've got all the tests listed in the test harness.

People can get used to anything; it's often hard to really analyze why
we like a particular system, beyond "that's what I'm used to".

-- 
-- Stephe



      parent reply	other threads:[~2011-10-14 11:55 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 23:38 organizing deep source trees with child packages Greg Moncreaff
2011-10-13  1:27 ` Yannick Duchêne (Hibou57)
2011-10-13  2:07   ` Greg Moncreaff
2011-10-13  3:52     ` Yannick Duchêne (Hibou57)
2011-10-13  3:55       ` Yannick Duchêne (Hibou57)
2011-10-13  4:21 ` Per Sandberg
2011-10-13  8:20 ` Stephen Leake
2011-10-13 13:19   ` Greg Moncreaff
2011-10-13 14:18     ` Ludovic Brenta
2011-10-13 22:25       ` Yannick Duchêne (Hibou57)
2011-10-14  1:44         ` Randy Brukardt
2011-10-14  2:40           ` Yannick Duchêne (Hibou57)
2011-10-16 12:38             ` Stephen Leake
2011-10-14  7:27         ` Dmitry A. Kazakov
2011-10-14  7:42           ` Yannick Duchêne (Hibou57)
2011-10-16 12:51           ` Stephen Leake
2011-10-16 13:43             ` Dmitry A. Kazakov
2011-10-16 18:51               ` Shark8
2011-10-16 19:19                 ` Ludovic Brenta
2011-10-17  7:04                   ` Simon Wright
2011-10-17  7:19                     ` Ludovic Brenta
2011-10-17  7:48                       ` Simon Wright
2011-10-17  7:56                         ` Ludovic Brenta
2011-10-17 10:27                           ` Simon Wright
2011-10-17 13:37                             ` Ludovic Brenta
2011-10-16 20:20               ` Yannick Duchêne (Hibou57)
2011-10-17  7:09               ` Simon Wright
2011-10-17  8:07                 ` Dmitry A. Kazakov
2011-10-18 11:12               ` Stephen Leake
2011-10-18 13:07                 ` Dmitry A. Kazakov
2011-10-18 16:55                   ` Simon Wright
2011-10-18 18:25                     ` Ludovic Brenta
2011-10-18 18:57                       ` Simon Wright
2011-10-18 22:00                         ` Bill Findlay
2011-10-19  6:28                           ` Simon Wright
2011-10-19  8:29                             ` Dmitry A. Kazakov
2011-10-19 11:52                               ` Yannick Duchêne (Hibou57)
2011-10-19 12:33                                 ` Dmitry A. Kazakov
2011-10-20 11:00                               ` Stephen Leake
2011-10-19 13:45                             ` Bill Findlay
2011-10-19  1:52                       ` Stephen Leake
2011-10-18 17:31                   ` Niklas Holsti
2011-10-18 18:38                   ` Ludovic Brenta
2011-10-19  1:55                     ` Stephen Leake
2011-10-19 10:41                     ` Dirk Craeynest
2011-10-19  1:51                   ` Stephen Leake
2011-10-19  9:03                     ` Dmitry A. Kazakov
2011-10-19  9:52                       ` Ludovic Brenta
2011-10-19 12:46                         ` Dmitry A. Kazakov
2011-10-19 16:43                           ` Ludovic Brenta
2011-10-19 20:01                             ` Yannick Duchêne (Hibou57)
2011-10-19 20:03                               ` Ludovic Brenta
2011-10-20 10:50                       ` Stephen Leake
2011-10-20 12:09                         ` Dmitry A. Kazakov
2011-10-14 11:55     ` Stephen Leake [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox