From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,20bf0d0544bba2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-10 05:48:26 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newsfeeds-atl2!news.webusenet.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <3FD72426.2010101@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Declaring subtypes References: <95476e79.0312090710.68a031a4@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 10 Dec 2003 13:48:25 GMT NNTP-Posting-Host: 209.165.2.84 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1071064105 209.165.2.84 (Wed, 10 Dec 2003 08:48:25 EST) NNTP-Posting-Date: Wed, 10 Dec 2003 08:48:25 EST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:3310 Date: 2003-12-10T13:48:25+00:00 List-Id: 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 ======================================================================