<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2>Given that the bindings are still in an early state of
development, there is no time like the present to make breaking changes! It
amounts to minor changes to existing code in most cases.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2>Along the same lines, the usual namespace convention is
CompanyName.Whatever. It would be much cleaner if the Gdal and Ogr namespaces
were under a common parent, such as Osgf or something
appropriate.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2>The fake enums you describe is what I had in mind and would
make things easier to manage. The only danger with using constants like that is
if the original value changes, the maintenance becomes a
nightmare.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843120122-02032007><FONT face=Arial
color=#0000ff size=2>Richard</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Simon Perkins [mailto:sy@perkins.net]
<BR><B>Sent:</B> March 2, 2007 4:50 PM<BR><B>To:</B> Richard
Matsunaga<BR><B>Cc:</B> gdal-dev@lists.maptools.org<BR><B>Subject:</B> Re:
[Gdal-dev] Some thoughts on C# SWIG wrapper<BR></FONT><BR></DIV>
<DIV></DIV>Richard Matsunaga wrote:
<BLOCKQUOTE cite=mid001b01c75d12$650d8d90$b8012b0a@Richard type="cite">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<DIV><SPAN class=843103515-02032007><FONT face=Arial size=2>I've just started
using the C# bindings and have some questions.</FONT></SPAN></DIV>
<DIV><SPAN class=843103515-02032007></SPAN> </DIV>
<DIV><SPAN class=843103515-02032007><FONT face=Arial size=2>1. Is the casing
used in the bindings a by-product of SWIG, or can this be changed to follow
the usual conventions? e.g. the 'gdal' class, the 'GDAL' namespace, the use of
underscores</FONT></SPAN></DIV></BLOCKQUOTE><BR>This would be nice, but I
suspect that there are a number of people out there using the existing bindings
who might object to having to change their code. Standard usage would have
called the GDAL namespace "Gdal", and the gdal class "Gdal" as well (I think
this would work), but I can live with this quirk.<BR><BR>
<BLOCKQUOTE cite=mid001b01c75d12$650d8d90$b8012b0a@Richard type="cite">
<DIV><SPAN class=843103515-02032007></SPAN> </DIV>
<DIV><SPAN class=843103515-02032007><FONT face=Arial size=2>2. Is it possible
to make enums out of the constants (since the values are dynamically
generated, even separate classes would be better), so they have some useful
context? It makes it much harder for non GDAL/OGR experts to find the correct
values.</FONT></SPAN></DIV></BLOCKQUOTE><BR>This would also be nice, but again
we have the backwards compatibility issue. We could keep the GDAL.gdalconst
class, but add the enums into the GDAL namespace, but then the GDAL functions
that currently expect ints would either have to be duplicated for enum versions,
or we'd break code.<BR><BR>One option would be to fake the enums with classes
like:<BR><BR><TT>namespace GDAL<BR>{<BR> public class
DataType<BR> {<BR></TT><TT>
public static const int Byte = 0;<BR></TT><TT>
public static const int Int16 = 1;<BR>
...<BR> }<BR>}<BR><BR></TT>We could add these classes in
addition to GDAL.gdalconst and allow people to use them
interchangeably.<BR><BR>Tamas: what do you
think?<BR><BR>Cheers,<BR><BR>Sy<BR><BR></BODY></HTML>