On Mon, Jan 27, 2014 at 5:51 PM, Andrea Aime
<[email protected]>wrote:
> My proposal to solve this problem - without a change in the API - is to
>> replace all occurrences of these variables in
>> AbstractGridCoverage2DReader to a call to functions. For example an
>> occurence of 'crs' in the code would be replaced by a call to
>> 'getCoordinateReferenceSystem(coverageName)'. All methods dependant on
>> these functions would take a 'coverageName' as argument, but a second
>> function without that argument would remain for backward compatibility,
>> using the 'coverageName' variable as argument. All the variables would
>> remain, the default implementation would be to return those variables.
>> This way geopkg can simply override the functions and ignore the
>> variables. But there would be perfect backward compatibility towards the
>> subclasses that use the variables.
>>
>
> But... isn't this what we have now?
>
> @Override
> public CoordinateReferenceSystem getCoordinateReferenceSystem(String
> coverageName) {
> if(!checkName(coverageName)){
> throw new IllegalArgumentException("The specified coverageName
> " + coverageName + "is not supported");
> }
>
> // Default implementation for backwards compatibility
> return getCoordinateReferenceSystem();
> }
> @Override
> public CoordinateReferenceSystem getCoordinateReferenceSystem() {
> return getCrs();
> }
>
Ah ok, got it, you want to replace the direct field access with function
calls.
Yes, it works... I'm just worried over time we'll have subclass code try to
access
fields directly.
Maybe make the fields private to eliminate the temptation fully?
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
-------------------------------------------------------
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel