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-Thread: 103376,381db495fa3adf75 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!news.germany.com!newsfeed1.funet.fi!newsfeeds.funet.fi!feeder1.news.saunalahti.fi!feeder2.news.saunalahti.fi!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Thu, 12 Mar 2009 09:26:41 +0200 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Package hierarchy. Extensibility. References: <91c9292b-d661-4744-bed2-b9c8a6305196@d19g2000yqb.googlegroups.com> In-Reply-To: <91c9292b-d661-4744-bed2-b9c8a6305196@d19g2000yqb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <49b8b91d$0$14980$4f793bc4@news.tdc.fi> Organization: TDC Internet Services NNTP-Posting-Host: 81.17.205.61 X-Trace: 1236842781 news.tdc.fi 14980 81.17.205.61:32794 X-Complaints-To: abuse@tdcnet.fi Xref: g2news2.google.com comp.lang.ada:5029 Date: 2009-03-12T09:26:41+02:00 List-Id: Jarno Neniu wrote: > Hello. I'm not able to decide about which design is the best > (extensibility, maintainability and recompilation friendliness are > important), so I'm demanding for any humble and not so humble > opinions. As an example of hierarchy consider representation of > geometrical points. One of representations is preferable and > considered to be the main representation (Cartesian 2D and 3D points), > but there is unspecified amount of other representations, which could > be added to the system later (points in polar, spherical, cylindrical > coordinate systems). Conversion between representations should be > somehow available and it is desirable for representations to be > generic. Which is the best way to design the hierarchy? Should it be > something like this: > > package Points is > -- Preferable representation. Cartesian point. > type Point is ... > end Points; > > package Points.Spherical is > type Spherical_Point is ... > end Points.Spherical; > > package Points.Cylindrical is > type Cylindrical_Point is ... > end Points.Cylindrical; > > Or should it be dummy package �Points� to which other representations > are connected: > > package Points is > end Points; > > package Points.Cartesian is > type Cartesian_Point is ... > end Points.Cartesian; > > package Points.Spherical is > type Spherical_Point is ... > end Points.Spherical; > > Something else? An interface type that defines the common view of "Points" of whatever representation? That would allow non-hierarchical and independent implementations of the representations as long as every representation implements this interface. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .