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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ccb21d128bf5f2ae X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!wns14feed!worldnet.att.net!attbi_s04.POSTED!53ab2750!not-for-mail From: "Jeff C r e e.m" Newsgroups: comp.lang.ada References: <1104237673.373489.128290@z14g2000cwz.googlegroups.com> <1104251213.061878.187430@f14g2000cwb.googlegroups.com> Subject: Re: newbie - OOP in Ada Set and Get Methods X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s04 1104253287 24.147.74.171 (Tue, 28 Dec 2004 17:01:27 GMT) NNTP-Posting-Date: Tue, 28 Dec 2004 17:01:27 GMT Organization: Comcast Online Date: Tue, 28 Dec 2004 17:01:27 GMT Xref: g2news1.google.com comp.lang.ada:7262 Date: 2004-12-28T17:01:27+00:00 List-Id: "R" wrote in message news:1104251213.061878.187430@f14g2000cwb.googlegroups.com... > Jeff C r e e.m wrote: >> A few tips to think about >> >> 1) Packages are closer to namespaces than classes. >> Your "field" variable is essentially just a stand alone 'global' > value >> that is in no way tied to your class >> >> 2) Tagged records are closer to "classes" > > so if my class has 7 varaibles(3 of them are dynamically allocated > arrays) they should be all included inside tagged record? In one way or another yes. Perhaps only in the private section of the package or in some cases by declaring an incomplete pointer to the remaining structure and then filling out the rest in the body. > > That means that when im creating an object I have to pass as parameters > all > the variables? I don't really follow that question. > >> 3) There is no "this" in Ada so if you want an object to be visible > within a >> subprogram it needs to be a parameter. > > thanks, I didn't know that > > And one more thing about the tutorial which You said should be > shutdown. > > It's written there that there is no such thing as contructor. > You'll have to define this function yourself. > > so if I want create an object you should write sth like this: > object : testclass.rec1_Type := testclass.Create(10); > > how should Create body look like? It is not possible for anyone to answer this question since we don't know what you are trying to accomplish. This sample code is too basic to really put any "design" thought into but for something that compiles. begin 666 testclass.ads M<&%C:V%G92!T97-T8VQA7!E(')E8S$@:7,@=&%G9V5D M( T*(" @("!R96-O7!E('=E('=E