comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: What's class?
Date: 1999/02/24
Date: 1999-02-24T00:00:00+00:00	[thread overview]
Message-ID: <7b1f5n$k5l$1@platane.wanadoo.fr> (raw)
In-Reply-To: 7avvpf$pfl@drn.newsguy.com


bill a �crit dans le message <7avvpf$pfl@drn.newsguy.com>...
>Since any type that extends a parent type, also inherits its
operations,
>then in this case, writing
>
>         function is_full( stack: in bounded_stack'class)
>and
>         function is_full( stack: in bounded_stack)
>
>
>make no difference!
>
>correct?
There is a huge difference between a class-wide operation and an
inherited operation.
An inheritede operation conceptually is part of the definition of the
type, and can be redefined by any descendant. In a sense, the original
operation serves as a "default value" for descendants that don't care
to redefine it.
OTOH,  a class wide operation operates conceptually on the full class;
it is not part of the type definition, it is not inherited, and in
cannot be redefined.

The nice thing with inherited operations is that you can redefine them
if you whish; the nice things with class-wide opertions is that you
are certain that nobody redefined the operation behind your back to
make it do something else.

Given your constraints, choose the appropriate one...
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://perso.wanadoo.fr/adalog






  reply	other threads:[~1999-02-24  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-23  0:00 What's class? Rouault
1999-02-23  0:00 ` David Botton
1999-02-24  0:00 ` Matthew Heaney
1999-02-23  0:00   ` bill
1999-02-24  0:00     ` Jean-Pierre Rosen [this message]
1999-02-24  0:00     ` Ed Falis
1999-02-25  0:00       ` dennison
1999-02-25  0:00     ` Matthew Heaney
1999-02-25  0:00 ` Gyeongmoon Ryu
1999-02-24  0:00   ` Matthew Heaney
replies disabled

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