[geos-devel] packages -> namespace

strk at refractions.net strk at refractions.net
Thu Nov 4 03:37:31 EST 2004

Hello all,
I've already sent a mail about this, but since I feel 
we really need to do that, I insist.
Please let me know what you think.

GEOS is a port from JTS.
IMO the port missed the package layout.
Every package in Java represent a separate namespace.

For example JTS has two PlanarGraph classes, one
in the geomgraph and another in the planargraph package.

In GEOS this became geos::PlanarGraph and geos::planarPlanarGraph.

This has two drawbacks:

	- hard-to-understand corrispondence between GEOS and JTS
	- possible name clashes

My suggestion is to map every JTS package to a GEOS sub-namespace,
as in:


Code that in JTS goes:

	import planargraph;

In GEOS would go:

	using namespace geos::planargraph;

A problem in this is that once again we'll break the API, but 
I knew we had API stability problems and hence I reduced the
documentation to the subset used by the main client: PostGIS.

If we base our versioning scheme on the documented part of
GEOS we can safely consider indexer, noder and graphs as new
interfaces, instead of a change in old interfaces.
I mean we could keep the 'geom' package in the root namespace
(geos) and just define a new namespace for every newly documented

What do you think about it ?


More information about the geos-devel mailing list