comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Setters and Getters - Classwide or Dispatching?
Date: Fri, 06 Jul 2001 15:47:11 GMT
Date: 2001-07-06T15:47:11+00:00	[thread overview]
Message-ID: <34l17.9638$Kf3.106061@www.newsranger.com> (raw)
In-Reply-To: I3k17.11641$F%5.755714@e420r-atl2.usenetserver.com

In article <I3k17.11641$F%5.755714@e420r-atl2.usenetserver.com>, Anthony E.
Glover says...
>
>What is the best approach for declaring setters and getters for a class -
>classwide or primitive subprograms. Classwide would seem to be the best
>approach since in all likelihood no one would override the getting or
>setting of an attribute; however, this means that the operation is not
>inherited by subclasses

It means it isn't overridable with a dispatching subprogram. You can still use
it for any subclass.

> and requires an additional 'with' and possible 'use'
>of the base class in order for the operation to be visible. Any suggestions?

One common approach is to put "child" classes in child packages. That way the
"with" and "use" are implicit.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



      reply	other threads:[~2001-07-06 15:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-06 14:42 Setters and Getters - Classwide or Dispatching? Anthony E. Glover
2001-07-06 15:47 ` Ted Dennison [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