comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: recursive with
Date: 1998/10/02
Date: 1998-10-02T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.98Oct2172034@spectre.mitre.org> (raw)
In-Reply-To: 361272E7.662A074@rol3.com

In article <361272E7.662A074@rol3.com> Alastair Brady <alastair.brady@rol3.com> writes:

 > For functions and procdures, if you need to make a call back to the package
 > which you have been called from, then logically either the current operation
 > of the operation you wish to call exists in the wrong package.  Either they
 > should all exist in the same package (if they are strongly related) or all
 > exist in separate packages.

   Good advice.

 > For types, it is common to declare a global 'types' package for types which
 > are common to multiple areas of the system, which is basically just a
 > package spec which is compiled first, and can then be with'ed by all other
 > packages.  Similarly this can be done for global data, but strictly speaking
 > all data should be encapsulated and accessed using access functions

   I'll call this dangerous advice, not really wrong.  It leads to bad
software engineering if a miscellany of types gets collected in a
single package.  When this happens the people on the project complain
about slow Ada compilers and forget to point the finger in the right
place.  Get rid of the global package, and you stop generating
problems every time one of the 43 people who think they own a type
make a "slight" change to it.

  The only global types package you need should be Standard.  (For
example, in doing simulations you need times all over the place.  I've
never had problems using Duration for that time type, but I guess it
could happen.) 
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




      parent reply	other threads:[~1998-10-02  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-30  0:00 recursive with David Pando
1998-09-30  0:00 ` Alastair Brady
1998-10-01  0:00   ` David Pando
1998-10-02  0:00   ` Robert I. Eachus [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