comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: OOD in Ada?
Date: Wed, 26 Jun 2002 08:49:54 -0400
Date: 2002-06-26T12:49:56+00:00	[thread overview]
Message-ID: <afcd9k$md8$1@nh.pace.co.uk> (raw)
In-Reply-To: Dl8S8.26239$cE5.16490@nwrddc02.gnilink.net

I'm not sure all the newsgroup data is getting through. I've outlined
basically that twice & maybe the OP isn't seeing it.

You can use child packages or non-child packages that inherit from some base
class. The important thing is that as long as the subclasses inherit from a
base class you can have an access value to anything within the class
heierarchy - hence classes "A" and "B" can have references to each other.

A good example of this is the XML DOM - You start with a base class called
"Node" which doesn't represent any actual elements in the DOM tree, but
defines some common characteristics. (Perfect case for an abstract class.)
All other elements of an XML document are represented as a derived class
from this base class. Since many of the XML document elements contain other
elements that might be composed of yet other elements of all sorts of types,
you need to have them able to hold references to each other but without the
"withing problem". The base class of type "Node" fixes this - you have an
access type that can reference anything of type Node'Class & then you're
stardust.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com


"Hyman Rosen" <hyrosen@mail.com> wrote in message
news:Dl8S8.26239$cE5.16490@nwrddc02.gnilink.net...
>
> Keeping in mind that I don't know Ada, isn't this what child packages are
for?
> Declare the base expression and statement classes in a package, and put
each
> descendant in its own child package.
>





  parent reply	other threads:[~2002-06-26 12:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-21 16:39 OOD in Ada? David Crocker
2002-06-21 17:20 ` Pat Rogers
2002-06-21 19:37   ` Ed Falis
2002-06-23  3:05   ` Ted Dennison
2002-06-23  7:03     ` tmoran
2002-06-24 21:41       ` Ted Dennison
2002-06-24 14:19     ` Stephen Leake
2002-06-21 17:22 ` Marin David Condic
2002-06-22  4:42 ` Jeffrey Carter
2002-06-22  9:18 ` Dr. Michael Paus
2002-06-22  9:47   ` Pascal Obry
2002-06-22 13:11     ` Dr. Michael Paus
2002-06-22 13:46       ` OOD in Ada? Correction Dr. Michael Paus
2002-06-22 18:21         ` Simon Wright
2002-06-28 23:57         ` Randy Brukardt
2002-07-09  8:45           ` Preben Randhol
2002-07-09 17:12             ` Mark Biggar
2002-07-09 19:40             ` Randy Brukardt
2002-06-23  3:33   ` OOD in Ada? steve_H
2002-06-23  4:55     ` Jim Rogers
2002-06-23  5:33       ` achrist
2002-06-25 18:00       ` Georg Bauhaus
2002-06-25 18:55         ` Marin David Condic
2002-07-07 18:19           ` Daniel Dudley
2002-06-23  7:46     ` Dr. Michael Paus
2002-06-24  5:06       ` steve_H
2002-06-23 19:26   ` Chad R. Meiners
2002-06-22 22:47 ` Dmitry A.Kazakov
2002-06-24 20:03 ` Kevin Cline
2002-06-25 13:32   ` David Crocker
2002-06-25 13:58     ` Marin David Condic
2002-06-26 18:16       ` tmoran
2002-06-26 18:47         ` Marin David Condic
2002-06-27 18:23           ` tmoran
2002-06-28 13:09             ` Marin David Condic
2002-06-26  0:59     ` Hyman Rosen
2002-06-26  4:57       ` Jim Rogers
2002-06-26 12:49       ` Marin David Condic [this message]
2002-06-26  9:01     ` Fraser Wilson
2002-06-29  0:08       ` Randy Brukardt
2002-07-01 11:50         ` Fraser Wilson
2002-07-05 20:02     ` Stephen J. Bevan
2002-07-09 19:19 ` Craig Carey
replies disabled

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