<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Richard Matsunaga wrote:
<blockquote cite="mid002a01c75d16$f102ba60$b8012b0a@Richard" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.6000.16414" name="GENERATOR">
  <div dir="ltr" align="left"><span class="843120122-02032007"><font
 color="#0000ff" face="Arial" 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>
</blockquote>
<br>
It's a reasonable bet that most people using the SWIG C# bindings are
on this list, so let's ask them! Anyone out there object to changing
the C# API in a majorly breaking way?<br>
<br>
<br>
<blockquote cite="mid002a01c75d16$f102ba60$b8012b0a@Richard" type="cite">
  <div dir="ltr" align="left"><span class="843120122-02032007"><font
 color="#0000ff" face="Arial" 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>
</blockquote>
<br>
Personally I think GDAL (or Gdal) is a sufficiently unique namespace
that there's not much to be gained by adding extra prefixes. But I
don't have a strong preference.<br>
&nbsp;
<blockquote cite="mid002a01c75d16$f102ba60$b8012b0a@Richard" type="cite">
  <div dir="ltr" align="left"><span class="843120122-02032007"><font
 color="#0000ff" face="Arial" 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>
</blockquote>
<br>
Wouldn't newly compiled code just pick up the new values of the
constants from the headers? Assuming people are not using numeric
literals in their code. In any case I see zero chance of these values
changing...<br>
<br>
Cheers,<br>
<br>
Sy<br>
<br>
<blockquote cite="mid002a01c75d16$f102ba60$b8012b0a@Richard" type="cite">
  <div dir="ltr" align="left">&nbsp;</div>
  <div dir="ltr" align="left"><span class="843120122-02032007"><font
 color="#0000ff" face="Arial" size="2">Richard</font></span></div>
  <br>
  <div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
  <hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b> Simon
Perkins [<a class="moz-txt-link-freetext" href="mailto:sy@perkins.net">mailto:sy@perkins.net</a>] <br>
  <b>Sent:</b> March 2, 2007 4:50 PM<br>
  <b>To:</b> Richard Matsunaga<br>
  <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.maptools.org">gdal-dev@lists.maptools.org</a><br>
  <b>Subject:</b> Re: [Gdal-dev] Some thoughts on C# SWIG wrapper<br>
  </font><br>
  </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>&nbsp;</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>&nbsp;</div>
    <div><span class="843103515-02032007"><font face="Arial" size="2">2.
Is it possible to make enums&nbsp;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>
&nbsp;&nbsp;&nbsp; public class DataType<br>
&nbsp;&nbsp;&nbsp; {<br>
  </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; public static const int Byte = 0;<br>
  </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; public static const int Int16 = 1;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>
&nbsp;&nbsp;&nbsp; }<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>
</blockquote>
<br>
</body>
</html>