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=0.8 required=5.0 tests=BAYES_50 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,17f44c9dee9867ce X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-08 22:15:43 PST Path: bga.com!news.sprintlink.net!cs.utexas.edu!swrinde!gatech!udel!news.mathworks.com!newshost.marcam.com!charnel.ecst.csuchico.edu!olivea!nntp-hub.barrnet.net!rational.com!rlk From: rlk@rational.com (Bob Kitzberger) Newsgroups: comp.lang.ada Subject: Re: [Q] Ada Archive? Date: 8 Mar 1995 07:10:26 GMT Organization: Rational Software Corporation Message-ID: <3jjl92$fk7@rational.rational.com> References: <3jf7m8$3jc@fu-berlin.de> NNTP-Posting-Host: pelton.rational.com X-Newsreader: TIN [version 1.2 PL2] Date: 1995-03-08T07:10:26+00:00 List-Id: Kelvin Pope (ccfk0@susx.ac.uk) wrote: : What I was wondering is there is an Ada archive anywhere that I : can pick up an example of this sort of program, each drink has a : number of units of alchohol, max legal level etc. Oh, this is much to vague. Don't touch that whizzy development environment until you fully analyze the problem domain (unless that whizzy development environment includes Rose, in which case, you get to avoid paper and pencil from the git-go). ;-) Let's see, we have several classes to describe before we get to the implementation: Person subclass Drinker attributes: weight, age, timeline for amount consumed Drink attributes: percentage of alcohol, quantity of drink Country attributes: legal age to drink; max legal level of alcohol in blood Turn on the stereo, perhaps the Brandenburg Concertos. Then, flesh out the domain classes. Then, have a Belgian beer and consider what to do next. You decide on implementing these classes in a simple way, leading to your first successful prototype. Then, have another beer and decide what to do next. "Identify risk areas" you mutter to yourself, and off you go... If the beer wasn't too strong, you'd probably realize that the only thing of any difficulty in this is the amount consumed / rate of decay. Decide on investigating this aspect further. Create implementation classes for this and include a reference from the Drinker class to this new timeline/decay Class. Have another beer. Implement your second prototype. Congratulate yourself for making progress so quickly. Have another beer. Wander over to the stereo and change the CD to something more in the mood, maybe some Hendrix or Stevie Ray Vaughn. Back in front of the computer; pop another beer. Decide that it would be very cool if each drink was its own subclass of drink, and start cataloguing every drink out of your "Pocket Bartender's Guide". Have a slightly muddled epiphany that you really should create a class for each _kind_ of alcohol (vodka, tequila, etc.) and the individual drink classes should each multiply inherit from all relevant Alcohol classes. Ooh, this is going to be a bit rough, so you have another beer. Draw a few of the hundreds of new class relationships needed, put that on the back burner when you think "persistence! that's what's missing!". Change the CD to Kraftwerk. Start your PPP connection, ask the people on comp.object for recommendations on a good OODBMS to use to keep track of all of those persistent objects. Make many many typos in your posting; everyone ignores it. Fall asleep on the keyboard. -- Bob Kitzberger +1 (916) 274-3075 rlk@rational.com Rational Software Corp., 10565 Brunswick Rd. #11, Grass Valley, CA 95945