comp.lang.ada
 help / color / mirror / Atom feed
From: Jarno Neniu <undet4@gmail.com>
Subject: Package hierarchy. Extensibility.
Date: Wed, 11 Mar 2009 17:02:17 -0700 (PDT)
Date: 2009-03-11T17:02:17-07:00	[thread overview]
Message-ID: <91c9292b-d661-4744-bed2-b9c8a6305196@d19g2000yqb.googlegroups.com> (raw)

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?



             reply	other threads:[~2009-03-12  0:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12  0:02 Jarno Neniu [this message]
2009-03-12  7:26 ` Package hierarchy. Extensibility Niklas Holsti
2009-03-13  1:31   ` Jarno
2009-03-13 10:58     ` Niklas Holsti
2009-03-13 11:03       ` Niklas Holsti
replies disabled

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