From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4cd85c8656c704b6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-03 04:55:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!intgwlon.nntp.telstra.net!news.telstra.net!news-server.bigpond.net.au!not-for-mail From: Dale Stanbrough Newsgroups: comp.lang.ada Subject: Re: Style question: deep inheritance References: <5463bc76.0212030344.712c30aa@posting.google.com> User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Message-ID: Date: Tue, 03 Dec 2002 12:55:57 GMT NNTP-Posting-Host: 144.132.47.50 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 1038920157 144.132.47.50 (Tue, 03 Dec 2002 23:55:57 EST) NNTP-Posting-Date: Tue, 03 Dec 2002 23:55:57 EST Organization: BigPond Internet Services (http://www.bigpond.net.au) Xref: archiver1.google.com comp.lang.ada:31376 Date: 2002-12-03T12:55:57+00:00 List-Id: 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