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-Thread: 103376,901038687c38f61c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!dedekind.zen.co.uk!zen.net.uk!demorgan.zen.co.uk!194.72.9.35.MISMATCH!news-peer1!btnet-feed3!news-peer0-test!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: Idiom for a class and an object in Ada Date: Mon, 18 Oct 2004 18:02:33 +0000 (UTC) Organization: BT Openworld Message-ID: References: NNTP-Posting-Host: host81-152-56-142.range81-152.btcentralplus.com X-Trace: titan.btinternet.com 1098122553 18373 81.152.56.142 (18 Oct 2004 18:02:33 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Mon, 18 Oct 2004 18:02:33 +0000 (UTC) X-RFC2646: Format=Flowed; Response X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Xref: g2news1.google.com comp.lang.ada:5406 Date: 2004-10-18T18:02:33+00:00 List-Id: > Does anybody have an opinion or experience with doing this? I know > what I've done in the past, but I'm curious if there is any preferred > method or idiom for this in the OO paradigm as applied to Ada? I tend to use Ward-Mellor RTSA/OOD as a method which leaves me with a number of "project specific" processes on static data. But the data type also leads to project specific classes (or ADT) which may be based on more general classes (e.g. containers). e.g. package General_Classes is -- Most re-usable type Class is private; end General_Classes; with General_Classes; package Project_Classes is -- Less re-usable type Class is private; procedure Process_1 (C : in out Class); procedure Process_2 (C : in out Class; I : Integer); private type Class is new General_Classes.Class with ...; end Project_Classes; package Project_Objects is -- Least re-usable procedure Process_1; -- Each process maps to a RTSA process (or a UML use-case) procedure Process_2; end Project_Objects; with Project_Classes; package body Project_Objects is Objects : Project_Classes.Class; -- Safely hidden data... procedure Process_1 is ... procedure Process_2 is ... end Project_Objects; It maps requirements to design to code very well. $0.02 -- Martin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.778 / Virus Database: 525 - Release Date: 15/10/2004