> Scratch scratch... so I always used reference in the intended double duty way
> without
> finding it hard to read the code. "I want a REferencedEnvelope, if the thing
> I pass you
> is already one just cast, if it's not please give me an equivalent
> ReferencedEnvelope"
>
>
>
Agreed, but part of the rats nest I found myself in this week was sorting out
how to safely handle ReferencedEnvelope or ReferencedEnvelope3D. I introduced
additional "reference" methods, with a javadoc saying they were factory methods.
And readability was harmed as a result .. so this is my bad and I want to fix
it before it spreads any further.
> To make the above distrinction clear I guess reference should stop doing the
> conversion,
> but that would be a serious backwards compatibility change.
>
>
>
I am happy with *reference* doing the conversion / casting. What I was not
happy with was the new "factory" methods making the situation confusing.
>
> Can you show some examples that are more clear with create than with
> reference?
Step 1): copy = new ReferencedEnvelope( envelope );
Step 2): copy = ReferencedEnvelope.reference( envelope ); // wait that is not a
copy?
Step 3): copy = ReferencedEnvelope.reference( envelope,
envelope.getCoordinateReferenceSystem() ); // whew it is a copy again - I found
a factory method
Step 4): copy = ReferencedEnvelope.duplicate( envelope ); // that is much more
clear
Step 5): copy = ReferencedEnvelope.create( envelope ); // clear and now I can
grab all the new "reference" methods that are just used to create (not cast)
under one heading
>
> Cheers
> Andrea
>
>
> --
> ==
> Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
> information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel