comp.lang.ada
 help / color / mirror / Atom feed
From: rlk@rational.com (Bob Kitzberger)
Subject: Re: [Q] Ada Archive?
Date: 8 Mar 1995 07:10:26 GMT
Date: 1995-03-08T07:10:26+00:00	[thread overview]
Message-ID: <3jjl92$fk7@rational.rational.com> (raw)
In-Reply-To: 3jf7m8$3jc@fu-berlin.de

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



  reply	other threads:[~1995-03-08  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-06 14:54 [Q] Ada Archive? Kelvin Pope
1995-03-08  7:10 ` Bob Kitzberger [this message]
1995-03-08 15:55 ` 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