comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dstanbro@bigpond.net.au>
Subject: Re: Style question: deep inheritance
Date: Tue, 03 Dec 2002 12:55:57 GMT
Date: 2002-12-03T12:55:57+00:00	[thread overview]
Message-ID: <dstanbro-13E9B6.23550403122002@mec2.bigpond.net.au> (raw)
In-Reply-To: 5463bc76.0212030344.712c30aa@posting.google.com

In article <5463bc76.0212030344.712c30aa@posting.google.com>,
 David95038@aol.com (David Kristola) wrote:

> I am working on a MUD in Ada.  Inheritance lends
> itself well to the problem domain, but after a few
> levels of child types in child packages, i am
> facing some ridiculously long names.  For
> instance, portals are used to move from place to
> place.  But they are a specialization of inanimate
> objects (things), which are a specialization of
> general things (entities), which are a
> specialization of the parent class (which is used
> to avoid the withing problem).  So, portal
> specific operations can be found in
> SAM.Entities.Things.Portals.  The three (and
> counting) specializations of Portals are only
> referenced once to initialize them and let them
> register themselves into the system.  I could use
> renames to flatten out the majority of references
> (package SAM.Portals renames
> SAM.Entities.Things.Portals;), but you can't
> inherit from a rename, so the actual children are
> still deeply nested.  The long package names
> usually mean long file names.  This could become a
> portability problem.

It's a portability problem for a number of reasons.
One is that there is no standard for filenames in 
Ada :-(.
Another is, of course, possible filename length
restrictions. However I think most O/S's these days
allow filenames of at least 256 chars, which you are
unlikely to reach in a hurry.

If you are using Gnat, then you can "krunch" the filenames
down to 8 chars (originally designed for DOS systems). This
has the benefit of portability, but the drawback of horrible
filenames, and, possibly, name conflicts.

I'ld simply suggest that you use the "use" clause
to reduce the baggage.

Dale



  reply	other threads:[~2002-12-03 12:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-03 11:44 Style question: deep inheritance David Kristola
2002-12-03 12:55 ` Dale Stanbrough [this message]
2002-12-03 12:56 ` Marc A. Criley
2002-12-04  6:56   ` Anders Wirzenius
2002-12-04 12:41     ` Marc A. Criley
2002-12-06 11:00       ` David Kristola
2002-12-09 15:05         ` Ted Dennison
2002-12-03 14:21 ` Stephen Leake
2002-12-04 19:19 ` Ted Dennison
replies disabled

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