[geos-devel] GeometryFactory - call for explanation

Martin Davis mbdavis at VividSolutions.com
Thu Mar 30 20:28:00 EST 2006


Those assumptions are correct.

There were two main reason for designing the GeometryFactory concept:

1) Provide a convenient, single location for defining the various "initial conditions" for Geometries.  This includes the Precision Model, the CoordinateSequenceFactory, and sometimes the SRID.  It may be extended in the future to contain things like which Polygon model to use, and preferences for precision handling.

2) Reduce the memory overhead of Geometries by moving relatively static objects (references) out of the Geometry and into a single shared object.

Hopefully this makes sense... But if anyone has good opinions about another design pattern, send them along.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> Mateusz Loskot
> Sent: March 30, 2006 5:10 PM
> To: GEOS Development List
> Subject: [geos-devel] GeometryFactory - call for explanation
> 
> 
> Hi,
> 
> Could anyone explain/confirm me assumptions behind
> the GeometryFactory class?
> Depending on its semantic I'd have some proposal to refactor 
> it. Here are my qusetions:
> 
> Are following assumptions correct?
> 
> 1. Ever instance of Geometry type (or its subtype) can have 
> assigned its own instance of GeometryFactory
> 
> 2. One instance of GeometryFactory class can be shared 
> (assigned to) between more than one objects of Geometry class
> 
> 3. It is not assumed that all geometries share the same
> common instance of GeometryFactory
> 
> Thanks in advance for comments
> Cheers
> -- 
> Mateusz Łoskot
> http://mateusz.loskot.net 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net 
> http://geos.refractions.net/mailman/listinfo/geos-devel
> 



More information about the geos-devel mailing list