[Java-collab] Re: invokeOperation and Jody's stupid idea

Matthias Basler matthiasbasler at earthflight.org
Sat Aug 15 03:09:44 EDT 2009


Jody wrote:

> Define "CRS" as per a the crs info idea as a wrapper / adapter between  
> the CoordinateReferenceSystem or CoordinateSystem choice and the  
> geometry implementation. We would need to provide enough information  
> here like Matthias indicates; and we could also include a Enum like  
> GEOM2D, GEOM2DZ etc... since both Jorge and Markus like Enums to  
> quickly make choices.
 
I am not a big fan of duplication of information, but in this case there is none. Imho each of 2D or 2D+Z or 3D geometries can have 2D *or* 3D CRS and are valid in any case, aren't they? (Not sure about 2D+M though.)

When I came across the 2D+Z vs. 3D problem I used the interface names to distinguish f.e. Triangle3D from Polygon2DZ, the latter being a polygon when looked from above, but with 3D coordinates

Having this info stored in an enum would just provide another, better way of accessing it. So I'm fine with it.


---

About this invokeOperation idea:

>From a programmer's POV this is a great idea, since it means that it is possible to add new operations without touching the geometry interface, which I consider a good design choice.

On the downside is that for the user buffer() or union() methods are more intuitive than an invokeOperation(), but this is imho acceptable.

P.S: The operations could be enumerations as well:
   mygeom.invokeOperation(Operation.Buffer);

That's it for now. I've got to catch a train and will be hiking the next two days. :-)
-- 
Matthias Basler
matthiasbasler at earthflight.org



More information about the Java-collab mailing list