MapServer / MapServer-import

3 stars 2 forks source link

mapscript API design problems -- specific issues for SWIG, C#, and Java #865

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: sgillies@frii.com Date: 2004/09/14 - 16:50

There is a C# and Java user that is helping me understand how SWIG generates
wrapper code for those languages.

When SWIG runs across a public structure member named, for example, 'foo' -- it
emits 'setFoo' and 'getFoo' methods for that structure's shadow class.  We are
running into problems where we have a public member and have already implemented
a setFoo function.

mapObj::extent and mapObj::setExtent are one problem.  As soon as we try to
do this for version 4.3 we are going to hit problems with layerObj::extent and
setExtent.

The mapObj::setExtent() should be replaced with a setExtentBounds() method.
This releases the name setExtent for use by SWIG.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2004/09/21 - 05:43

Resolved for layer extents by hiding the layerObj::extent attribute from
swigjava and allowing access through getExtent/setExtent only.  Will 
approach mapObj extent in the same manner.

Correction: after a closer reading of the C# swig docs, this is only a Java
problem.  C# has Python-like properties rather than the Java setters and
getters.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2004/09/25 - 18:14

I'm now regularly testing Java mapscript builds and we are good to go in
4.2 as well as CVS HEAD.