From: Marin David Condic <nobody@noplace.com>
Subject: Re: Declaring subtypes
Date: Wed, 10 Dec 2003 13:48:25 GMT
Date: 2003-12-10T13:48:25+00:00 [thread overview]
Message-ID: <3FD72426.2010101@noplace.com> (raw)
In-Reply-To: 95476e79.0312090710.68a031a4@posting.google.com
Of course, it depends a little on the nature of the database, but
subtypes are not inappropriate for database fields that you expect to
have around as more or less permanent things. You might also consider
bounded strings or unbounded strings as possibly useful ways of storing
& manipulating things you expect to keep in a database. In any event,
you could create subtypes from these as well to help you protect against
mixing things up & to be sure everyone is using common sizes for the fields.
MDC
Kevin Hostelley wrote:
> I am rather new to Ada and I had a design question. I'm working on a
> web based application and I was wondering if declaring subtypes of
> String for common database fields was overkill. For example:
>
> subtype Address_Line is String(1..60);
> subtype City is String(1..40);
> subtype Zip_Code is String(1..9);
>
>
> I understand that Strong typing is one of the strengths of Ada but I
> just don't know how far to go with it.
>
> Thanks,
>
> mamboking
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm
Send Replies To: m o d c @ a m o g
c n i c . r
"Trying is the first step towards failure."
-- Homer Simpson
======================================================================
prev parent reply other threads:[~2003-12-10 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-09 15:10 Declaring subtypes Kevin Hostelley
2003-12-09 15:52 ` Georg Bauhaus
2003-12-09 17:01 ` Martin Krischik
2003-12-09 18:47 ` tmoran
2003-12-10 13:48 ` Marin David Condic [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