From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Naive question about system dependencies
Date: 22 Sep 1994 14:54:10 GMT
Date: 1994-09-22T14:54:10+00:00 [thread overview]
Message-ID: <35s5qi$174n@watnews1.watson.ibm.com> (raw)
In-Reply-To: 85B716C4188@annwfn.com
In article <85B716C4188@annwfn.com>, merlin@annwfn.com (Fred McCall) writes:
|> In <35f559$mad@info.epfl.ch> weber@lglsun.epfl.ch Mats Weber writes:
|>
|> >In many cases, a single package specification with different bodies
|> >solves the problem. In other cases, the private part of the package
|> >needs to be different in different variants (this means duplication of
|> >the spec in Ada 83, Ada 9X has significant imporvements for handling
|> >such cases).
|> >
|> >Using a good file naming convention helps a lot in managing the
|> >different versions. We use something like this:
|> >
|> >sql_interface.ads (common package spec)
|> >sql_interface-oracle-vms.adb (body for Oracle under VMS)
|> >sql_interface-sybase-unix.adb (body for Sybase under UNIX)
|> >
|> >Despite the amount of code duplication, I prefer this to a preprocessor
|> >approach.
|>
|> One thing to be *very* wary of -- during maintenance, if you find and
|> fix a bug in one variant, you'd better check all those other alternate
|> bodies for the same bug and apply the same fix. I agree with the
|> difficulty of reading heavily ifdef'd sources, but they do have the
|> advantage of putting all the source code in one place (which simplifies
|> source control on bug fixes).
Quite true. That's why the design should strive to isolate the target
dependencies as much as possible. Ideally, the multiple versions differ
only in a few very small units that define a few exported constants and
low-level subprograms differently, but invoke common code that
constitutes the bulk of the system.
--
Norman H. Cohen ncohen@watson.ibm.com
next prev parent reply other threads:[~1994-09-22 14:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-09-15 6:32 Naive question about system dependencies Howard Holm
1994-09-16 17:28 ` Tucker Taft
1994-09-17 16:23 ` Mats Weber
1994-09-19 12:05 ` Ted Dennison
1994-09-19 14:39 ` Cyrille Comar
1994-09-19 15:00 ` Norman H. Cohen
1994-09-20 9:02 ` Stephen J Bevan
[not found] ` <85B716C4188@annwfn.com>
1994-09-22 13:33 ` David Kehs
1994-09-22 14:15 ` Robert Dewar
1994-09-23 4:34 ` R. William Beckwith
1994-09-22 14:54 ` Norman H. Cohen [this message]
-- strict thread matches above, loose matches on Subject: below --
1994-09-19 14:48 Bob Crispen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox