comp.lang.ada
 help / color / mirror / Atom feed
From: WATANABE Katsuhiro <katsu@watanabe.name>
Subject: simulate inheritance with generic package
Date: 25 Aug 2003 10:25:23 +0900
Date: 2003-08-25T10:25:23+09:00	[thread overview]
Message-ID: <usmnqa5q4.fsf@katsu.watanabe.name> (raw)

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 instanciation 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



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

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

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