comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert C. Leif" <rleif@rleif.com>
To: "'WATANABE Katsuhiro'" <katsu@watanabe.name>,
	"Comp. Lang. Ada" <comp.lang.ada@ada.eu.org>
Subject: RE: simulate inheritance with generic package
Date: Mon, 25 Aug 2003 07:25:38 -0700
Date: 2003-08-25T07:25:38-07:00	[thread overview]
Message-ID: <mailman.8.1061821596.318.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <usmnqa5q4.fsf@katsu.watanabe.name>

You can also create generic types and objects for the fields of a tagged
record that is contained in a generic package. In Ada it is not generic or
tagged; they can be combined to serve as an excellent model for real-world
objects. Unfortunately, it is not obvious how to handle a record's tag when
creating a representation specification of hardware, such as a register or
memory address.

Bob Leif
Robert C. Leif, Ph.D.
Email rleif@rleif.com

-----Original Message-----
From: WATANABE Katsuhiro [mailto:katsu@watanabe.name] 
Sent: Sunday, August 24, 2003 6:25 PM
To: comp.lang.ada@ada.eu.org
Subject: simulate inheritance with generic package

I'd like to know how to simulate inheritance in OO with
generic package in classic Ada, which has no tagged type.

An ancient OO book(*) instructs a way of inheritance
implementation in Ada by introducing has-a reference from
child class to parent class. And it says their functions
should be linked, that is to say, any call to the child
instance must be delegated to the parent instance. And
the description goes on as follows:

> If you use generic package this linkage can be made
> by using a specific routine as the relevant (generic)
> parameter when instantiating the package.

But, what does 'a specific routine' means?

As I am a Smalltalk programmer, I have limited knowledge
on Ada and its instantiation mechanism of generic package.
So, I'd appreciate your help showing concretely what 
'a specific routine' is.

(*)
Ivar Jacobson;
Object-Oriented Software Engineering
--- A Use Case Driven Approach ---;
Addison-Wesley;
1994

-- 
WATANABE Katsuhiro




      parent reply	other threads:[~2003-08-25 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-25  1:25 simulate inheritance with generic package WATANABE Katsuhiro
2003-08-25  2:04 ` Matthew Heaney
2003-08-25 14:25 ` Robert C. Leif [this message]
replies disabled

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