[vtk-developers] Re: vtkSQLDatabase

Sebastien BARRE sebastien.barre at kitware.com
Wed Nov 28 11:37:33 EST 2007


At 11/27/2007 07:57 PM, David C Thompson wrote:
> > I don't mind having such a function available.  Should the method that does
> > the heavy lifting (static void ParseURL) go in vtkSQLDatabase or is there a
> > more suitable home for it?  Offhand I don't see an appropriate class for it
> > (there are XMLUtilities, TimePointUtility, FreeTypeUtilities, but no
> > StringUtilities).
>The closest thing there is Utilities/kwsys/SystemTools.hxx.in. Since
>ParseURL would only use the kwsys/RegularExpression class perhaps it
>belongs in kwsys?

Traditionally, yes, this is where we've put them (if the function is 
deemed useful), that's why there is no StringUtilities in VTK.

> > > 2. Adding enums to represent the various basic column storage types?
> > >    This is an area where SQL implementations vary significantly.
> >
> > I think this is a good idea modulo wrapping concerns (see below).
>
>I don't see any advantage that #define statements have over enums as far
>as wrapping -- with the proper "//BTX ... //ETX" both get ignored by the
>wrapper generate and anyone using Tcl, Python, etc. must have knowledge
>of their values to use them. The only exceptions appear to be some
>hand-coded values for the Python wrappers.

Enums have usually more advantages than #define, so I'd say, go for 
enums, but I also second Andy's opinion, be careful about wrapping, 
please do take into account that people will want to use this 
framework from Tcl, Python, etc, you can't just BTX/ETX. Assuming 
people will use the hard-coded enum value in Tcl is not a good 
solution, especially since anyone can insert a new enum value on the 
list later on, not necessarily at the end (hilarity ensues). Check 
with Brad King, maybe something can be done along the lines of the 
keys that are used in the pipeline (are they wrappable).

Also why wouldn't SetURL/GetURL be public. Am I missing something? 
Wouldn't you want to reconnect or connect to a different database? Or 
do you guys enforce a new database object each time? 




More information about the vtk-developers mailing list