comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@blueyonder.co.uk>
Subject: Re: Need advice re package organization.
Date: Sat, 26 Jul 2003 18:03:13 +0100
Date: 2003-07-26T18:03:13+01:00	[thread overview]
Message-ID: <bfuc4s$inmb6$1@ID-25716.news.uni-berlin.de> (raw)
In-Reply-To: pan.2003.07.26.13.08.25.810488@mail.utexas.edu

"Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote in message
news:pan.2003.07.26.13.08.25.810488@mail.utexas.edu...

> Most of my work with Ada has involved either smallish
> programs or simple self-contained library units where a
> good package organization was obvious, but now I'm
> doing something with several layers of interrelated parts
> and I'd like to get some experienced advice on how to
> organize my components into packages.
> ...
> 3) Create a lean parent package and implement each
> object in a separate child package, "with"ing the others
> as needed.

In situations like this, I tend to aim for lots of relatively small packages
and subunits.

Generally, I'll have one major type, together with its auxiliary types, and
the associated operations in one package. Sometimes I'll have or three quite
closely coupled types in one package; I'm generally convinced a set of types
are closely coupled if there are a lot of operations with a mixture of them
as parameters. I like to hive off big bodies (ooer :-) into subunits.

At first, it can seem like a right pain doing this, since it is taxing
thinking up names of all packages, time consuming creating all the separate
files, with their headers and paraphernalia, and so on. In addition, you
tend to have to use long-winded extended names a great deal, and you also
tend to find that you need to re-organise things half way through, which
means lots more creating of files and shuffling about of code.

However, I have found through (very ;-) hard experience that as I start
getting deeply into a project of any size, my brain starts turning into
jelly, and I find it increasingly hard to keep track of what is where. It is
then that having a well-organised package and subunit hierarchy pays off in
a big way. When you see a call to the procedure Blurg.Boogle.Watcha.Gerrof
and you want to look at its body, you know all you have to do is call up
"blurg-boogle-watcha-gerrof.adb" and there it is; no searching through reams
of code in a giant package body.

Hope this is of some help. Best of luck!

--
Nick Roberts
Jabber: debater@charente.de [ICQ: 159718630]






      parent reply	other threads:[~2003-07-26 17:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-26 13:08 Need advice re package organization Bobby D. Bryant
2003-07-26 14:25 ` Robert I. Eachus
2003-07-26 15:27   ` Warren W. Gay VE3WWG
2003-07-26 22:00     ` Robert I. Eachus
2003-07-27 22:01       ` chris
2003-07-28  2:53         ` Robert I. Eachus
2003-07-29  4:52           ` Richard Riehle
2003-07-27 22:02       ` Warren W. Gay VE3WWG
2003-07-28  8:38         ` Dmitry A. Kazakov
2003-07-29 17:18           ` Warren W. Gay VE3WWG
2003-07-30  8:42             ` Dmitry A. Kazakov
2003-07-30 21:00               ` Warren W. Gay VE3WWG
2003-07-30 22:46                 ` Randy Brukardt
2003-07-31 16:39                   ` Warren W. Gay VE3WWG
2003-07-31 17:31                     ` Randy Brukardt
2003-07-31 21:00                       ` Warren W. Gay VE3WWG
2003-07-31 22:13                     ` Robert I. Eachus
2003-08-01 12:51                       ` Warren W. Gay VE3WWG
2003-07-31  5:57                 ` Matthew Heaney
2003-07-31 16:57                   ` Warren W. Gay VE3WWG
2003-07-31 22:33                     ` Robert I. Eachus
2003-08-01  2:58                       ` Chad R. Meiners
2003-08-01 13:51                         ` Stephen Leake
2003-08-01 22:15                           ` Robert I. Eachus
2003-08-04 13:45                             ` Stephen Leake
2003-08-01 13:01                       ` Warren W. Gay VE3WWG
2003-07-31  9:04                 ` Dmitry A. Kazakov
2003-07-31 16:59                   ` Warren W. Gay VE3WWG
2003-07-31 20:41                     ` Randy Brukardt
2003-07-31 21:15                       ` Warren W. Gay VE3WWG
2003-08-01 20:04                         ` Randy Brukardt
2003-08-01 21:33                           ` Stephen Leake
2003-08-04 19:40                             ` Randy Brukardt
2003-08-04 19:52                               ` Stephen Leake
2003-08-05  3:36                   ` Richard Riehle
2003-08-05  4:03                     ` Hyman Rosen
2003-08-05  7:16                     ` Dmitry A. Kazakov
2003-07-26 17:03 ` Nick Roberts [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