comp.lang.ada
 help / color / mirror / Atom feed
From: rlk@rational.com (Bob Kitzberger)
Subject: Re: Help: Ada and Object-Oriented Methodologies
Date: 27 Feb 1995 20:03:08 GMT
Date: 1995-02-27T20:03:08+00:00	[thread overview]
Message-ID: <3itb5s$36n@rational.rational.com> (raw)
In-Reply-To: FRSANMAR.95Feb25124152@rs6550.mor.itesm.mx

[tried email, but it bounced...]

There are two versions of the Ada standard: Ada 83, which supports
object-based programming; and Ada 95 which supports object-oriented
programming directly.

For a discussion of Ada83 object-based programming, see Booch's book
(the first edition) of "Object Oriented Design with
Applications". Basically, you define a class as a private type, and
encapsulate it and all of its functions in a package, e.g.:

	-- Ada 83 object-based example
	with Color;		-- other classes referenced
	with Manufacturer;	--  "
	package Automobile is

	  type Object is private;

	  function Create( The_Color : Color.Object;
			   The_Manufacturer : Manufacturer.Object )
			   return Object;

	  procedure Destroy ( The_Auto : in out Object );

	  function The_Color( Of_Auto : in Object ) return Color.Object;
	  function The_Manufacturer( Of_Auto : in Object ) return
		Manufacturer.Object;

	  ...etc other selectors/accessors/etc...
	private
	  type Object is ...
	end Automobile;

Using this "class":

	My_Car : Automobile.Object :=
		Automobile.Create( Color.Hunter_Green,
				   Manufacturer.Jeep );
	...
	C : Color.Object := Automobile.The_Color( My_Car );


For Ada95 clases, inheritance, etc.  see the Ada 95 reference manual
(poke around in the <A HREF="http://lglwww.epfl.ch/Ada/"> Home of the
Brave Ada Programmers </A>


--
Bob Kitzberger	        +1 (916) 274-3075	        rlk@rational.com
Rational Software Corp., 10565 Brunswick Rd. #11, Grass Valley, CA 95945
  "...the solution to the problem is usually to pee on it"  -- Dave Barry



  reply	other threads:[~1995-02-27 20:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-25 18:41 Help: Ada and Object-Oriented Methodologies Francisco San Martin Roman
1995-02-27 20:03 ` Bob Kitzberger [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-02-27 19:53 Help " Francisco San Martin Roman
1995-02-27 19:58 Help: Ada and object-oriented methodologies Francisco San Martin Roman
1995-02-27 22:24 ` WLawton
1995-02-28  2:19 ` David Weller
replies disabled

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