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.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,900edaa189af2033,start X-Google-Attributes: gid103376,public From: cosc19z5@Bayou.UH.EDU (Spasmo) Subject: Ada95 OOP Questions Date: 1996/07/28 Message-ID: <4tf3l4$4hu@masala.cc.uh.edu>#1/1 X-Deja-AN: 170543899 organization: University of Houston newsgroups: comp.lang.ada Date: 1996-07-28T00:00:00+00:00 List-Id: Hi. First off thanks for all the help I've gotten here already. I'm currently cranking out some code to get familiarized with Ada and it's going wonderfully. Now with that in mind what I have to ask is a bit long winded and maybe a bit vague, but I'll try to put it as best as I can. Ok, with regards to OOP, my previous experience has been with C++. In that language when you declare a class, it consists of data (which can be at various visibility levels (ie: private)), and methods which operate on the data in the class. What this results in is an object (loose use) that has its own actions and its own attributes so that it's a self contained entity so to speak. For instance here's a crude idea: class Person { public: void Walk(); void Talk(); void Eat(); private: int Age; char Name[256]; }; When an instance of Person is declared, you just make calls to the functions provided in that class and all the data associated with Person is kept inside it and manipulated in it. You can of course inherit, use polymorphism, etc... Well after looking at Barnes' Ada95 book and checking out the OOP sections I noticed that the Objects in Ada95 seem to consist purely of data, and no methods seem to be involved so that you have to pass these objects to functions in order to get stuff done. Am I wrong in this (or did I somehow miss something again?). In any case I've been looking at using private Objects inside packages and using these objects as package-global variables to all the procedures/functions involved so that one can simulate this sort of behavior, although the simulation isn't perfect. Well my other question has to do with whether or not I should do this? I mean I have a decent grasp of using Ada for programming, but am I truly programming in Ada? Am I trying to program in C++, but I just happen to be using Ada to do it? What is the consensus on this, and also would anyone describe the philosophy behind this implementation of OOP? I'm being careful because I also was confused as to tasks not seeming to employ time-slices in my implementation only to realize that it was a blessing in disguise, so I'm approaching this OO implementation in the same way, namely that there is something inherent that I am not getting that makes this a very good thing. Thanks and I hope my question was somewhat understandable. -- Spasmo "Everyone has secrets, but sometimes you get caught, So if it's just between us, my silence can be bought" "Blackmail" by Sloppy Seconds