[Java-collab] geometry factory vs interface

Markus Schneider schneider at lat-lon.de
Thu Aug 20 05:43:09 EDT 2009


Hello Jorge,

Jorge Piera wrote:

> I think that one of the main goals of this project has to be to define
> an API for geometries and the usage of Interfaces is normally more
> flexible that the usage of abstract classes. I always prefer to define a
> Interface and a default implementation for this Interface.
> 
> In the proposal of interfaces that Markus did I've seen methods like:
> 
> - public boolean isBeyond( Geometry geometry, Measure distance );
> - public boolean isWithin( Geometry geometry );
> - public boolean overlaps( Geometry geometry );
> - ...
> 
> that are not refered to the geometry structure. They are operations! We
> have to separate structure of functionality and I suggest that all these
> methods have not to be here.
> 
> In gvSIG we have replaced all these methods by just one:
> 
> - public Object invokeOperation(int index, GeometryOperationContext ctx)
> 
> Details can be found here [1]. Yes, we know that we are losing
> performance with this option but we are winning in other issues:
> 
> - The Geometry Interface is always the same (we don't have the problem
> that has been commented above).
> - Using this system is possible to provide a new implementation of one
> concrete operation associated to a GeometryType and it is not necessary
> to update the GeometryType (separation between structure and
> functionality).

I agree that this adds a lot of flexibility. However, it also appears to be a bit complicated for a user who just wants
to test two geometries for intersection. In my experience, the topological and spatial analysis operations offered by
GIS-systems are always (mostly) identical. Do you have any concrete use-cases for other operations or is your motivation
here just to keep this as extensible as possible?

Best regards,
Markus
-- 
Markus Schneider

l a t / l o n  GmbH
Aennchenstrasse 19           53177 Bonn, Germany
phone ++49 +228 184960       fax ++49 +228 1849629
http://www.lat-lon.de        http://www.deegree.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.osgeo.org/pipermail/java-collab/attachments/20090820/146c5505/signature.bin


More information about the Java-collab mailing list