comp.lang.ada
 help / color / mirror / Atom feed
From: mjmeie@ss5.magec.com (Mike Meier)
Subject: Re: Optimizing and Constraint Checks
Date: 1995/03/30
Date: 1995-03-30T00:00:00+00:00	[thread overview]
Message-ID: <D69B0F.I66@ss3.magec.com> (raw)
In-Reply-To: edward-2903951038050001@r-618macip27.hac.com

Ed Bruce (edward@igate1.hac.com) wrote:

: Which leads to an increased risk of making a mistake that won't be caught
: easily if at all. That is if the an enumerated_value'POS is currently 5 in
: the database and should be changed to 4 (a literal was deleted), but is
: changed to 3. Well enumeration_type'VAL(3) is this case is legal but
: invalid.

: So I have suggested to the principal engineers on our project that we use
: enumeration representation clauses and unchecked type conversion.

We faced the same problems on our rather large (1M SLOC) project with lots
of enumerated types in the DB.  It turns out that even rep clauses
and unchecked type conversions have potential for maintainability and
portability problems.  Our solution was to require the definition and use
of a set of mapping functions (for which we provided a generic) for every
enumerated type to be stored in the DB.  This may seem like overkill, but
it saved significant effort overall the (so far) 5-year life of the
project.  Additional benefits were that the values used in the DB could
be used in many other contexts, and that the values could be defined in
the body rather than the spec (which reduced recompilation when a value
had to be changed).




  parent reply	other threads:[~1995-03-30  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-23 16:04 Optimizing and Constraint Checks Ed Bruce
1995-03-24 13:34 ` Theodore Dennison
1995-03-25 18:09   ` David Wheeler
1995-03-29  0:00   ` Ed Bruce
1995-03-24 20:15 ` Garlington KE
1995-03-26 12:01   ` Robert Dewar
1995-03-27 16:58     ` Garlington KE
1995-03-29  0:00     ` Ed Bruce
1995-03-29  0:00       ` Garlington KE
1995-03-30  0:00       ` Mike Meier [this message]
1995-04-04  0:00       ` Robert Dewar
1995-03-25 17:51 ` Robert Dewar
replies disabled

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