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,538a77d38ac42215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-27 12:03:08 PST Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!agate!nntp-ucb.barrnet.net!nntp-hub.barrnet.net!rational.com!rlk From: rlk@rational.com (Bob Kitzberger) Newsgroups: comp.lang.ada Subject: Re: Help: Ada and Object-Oriented Methodologies Date: 27 Feb 1995 20:03:08 GMT Organization: Rational Software Corporation Distribution: world Message-ID: <3itb5s$36n@rational.rational.com> References: NNTP-Posting-Host: bonnie.rational.com X-Newsreader: TIN [version 1.2 PL2] Date: 1995-02-27T20:03:08+00:00 List-Id: [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 Home of the Brave Ada Programmers -- 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