comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Instantiation of child generics?
Date: 1996/07/30
Date: 1996-07-30T00:00:00+00:00	[thread overview]
Message-ID: <DvDI33.AMp@world.std.com> (raw)
In-Reply-To: 4tkuv1$3jm@goanna.cs.rmit.edu.au


In article <4tkuv1$3jm@goanna.cs.rmit.edu.au>,
Dale Stanbrough  <dale@goanna.cs.rmit.EDU.AU> wrote:
>concrete unbounded type "queue"). The benefits are that (if you use use)
>you can write your code
>
>	myQ:queue;
>	
>and get diff. implementations by changing the with clause. What problems
>do you forsee in doing this?

Well, it's hardly a big deal, but I just don't like having zillions of
things called "queue".  It seems confusing.

Your "benefit" above only works if there is only one type of queue being
used in this module, by the way.

If I were using the style of calling all queue types "queue", I would
prefer to refer to Whatever_Pkg.Queue.  I really don't mind doing a
search-and-replace operation if I want to change what sort of queue it
is.  Emacs can search through multiple files, so it's not that hard.
And if you make a mistake, it will likely be detected at compile time.
You need to do that search anyway, just in case somebody used an
expanded name instead of a use_clause.

Finally, if you really want flexibility, you can use abstract class-wide
objects (or pointers to them), and try to localize the creation of
objects in a Factory package (which is often a good idea anyway).

Again, it's no big deal, either way.

- Bob




      reply	other threads:[~1996-07-30  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-26  0:00 Instantiation of child generics? Dale Stanbrough
1996-07-26  0:00 ` Robert A Duff
1996-07-26  0:00 ` Tucker Taft
1996-07-26  0:00   ` Kevin J. Weise
1996-07-27  0:00     ` Robert A Duff
1996-07-30  0:00       ` Dale Stanbrough
1996-07-30  0:00         ` Robert A Duff [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