comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@btopenworld.com>
Subject: Re: Idiom for a class and an object in Ada
Date: Mon, 18 Oct 2004 18:02:33 +0000 (UTC)
Date: 2004-10-18T18:02:33+00:00	[thread overview]
Message-ID: <cl10fp$hu5$1@titan.btinternet.com> (raw)
In-Reply-To: M3Ocd.237$5i5.72@newsread2.news.atl.earthlink.net

> 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 





  parent reply	other threads:[~2004-10-18 18:02 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 11:47 Idiom for a class and an object in Ada Marin David Condic
2004-10-18 12:14 ` Martin Krischik
2004-10-18 19:40   ` Matthew Heaney
2004-10-19 12:59   ` Marin David Condic
2004-10-19 14:46     ` Martin Dowie
2004-10-19 15:55       ` Matthew Heaney
2004-10-19 18:31         ` Martin Dowie
2004-10-19 15:52     ` Matthew Heaney
2004-10-18 12:26 ` Marius Amado Alves
2004-10-19  2:09   ` Jeffrey Carter
2004-10-19  3:28     ` Matthew Heaney
2004-10-19 12:53       ` Marin David Condic
2004-10-19 14:44         ` Matthew Heaney
2004-10-19 15:01           ` Dmitry A. Kazakov
2004-10-19 15:40             ` Matthew Heaney
2004-10-20  7:58               ` Dmitry A. Kazakov
2004-10-20 12:31                 ` Marin David Condic
2004-10-20 13:53                   ` Dmitry A. Kazakov
2004-10-20 15:23                   ` Matthew Heaney
2004-10-21 12:24                     ` Marin David Condic
2004-10-21 17:15                       ` Matthew Heaney
2004-10-20  5:39         ` Simon Wright
2004-10-20  7:24           ` Matthew Heaney
2004-10-20  8:39             ` Dmitry A. Kazakov
2004-10-21  1:36             ` Jeffrey Carter
2004-10-21  1:46               ` Matthew Heaney
2004-10-21  7:51                 ` Dmitry A. Kazakov
2004-10-21 12:45                   ` Matthew Heaney
2004-10-21 14:11                     ` Dmitry A. Kazakov
2004-10-22  1:04                 ` Jeffrey Carter
2004-10-22  1:36                   ` Matthew Heaney
2004-10-21 19:31               ` Kevin Cline
2004-10-21 22:02                 ` Matthew Heaney
2004-10-22  0:10                   ` Matthew Heaney
2004-10-21  8:25             ` Martin Dowie
2004-10-20 17:04           ` Matthew Heaney
2004-10-20 19:37             ` Simon Wright
2004-10-20 20:04               ` Matthew Heaney
2004-10-22  5:37                 ` Simon Wright
2004-10-20  1:10       ` Jeffrey Carter
2004-10-20  7:04         ` Matthew Heaney
2004-10-20 12:42           ` Marin David Condic
2004-10-20 12:55             ` Matthew Heaney
2004-10-20 15:27             ` Matthew Heaney
2004-10-21  1:36               ` Matthew Heaney
2004-10-19 12:38   ` Marin David Condic
2004-10-18 16:59 ` Matthew Heaney
2004-10-18 18:02 ` Martin Dowie [this message]
2004-10-19 13:06   ` Marin David Condic
2004-10-19 14:51     ` Martin Dowie
2004-10-20 16:20 ` Michael Paus
2004-10-20 17:15   ` Matthew Heaney
2004-10-20 17:55     ` Michael Paus
2004-10-21 12:33   ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2004-10-21 13:59 Stephen Leake
replies disabled

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