comp.lang.ada
 help / color / mirror / Atom feed
* Package hierarchy. Extensibility.
@ 2009-03-12  0:02 Jarno Neniu
  2009-03-12  7:26 ` Niklas Holsti
  0 siblings, 1 reply; 5+ messages in thread
From: Jarno Neniu @ 2009-03-12  0:02 UTC (permalink / 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?



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-13 11:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12  0:02 Package hierarchy. Extensibility Jarno Neniu
2009-03-12  7:26 ` Niklas Holsti
2009-03-13  1:31   ` Jarno
2009-03-13 10:58     ` Niklas Holsti
2009-03-13 11:03       ` Niklas Holsti

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