Driver upgrade - class naming and namespace query

  • Thread starter Thread starter Tim Anderson
  • Start date Start date
T

Tim Anderson

I've been working on the Mono Sqlite 2.x client
(http://www.go-mono.com/sqlite.html) in order to make it work with Sqlite
3.0. Note that I have nothing to do with Mono, but I find this code useful
for working with Sqlite in Microsoft .NET. I'm wondering what would be the
best way to name the classes.

The Sqlite data format changed from version 2.x to 3.x, so I need a
different set of classes for the new version. Currently the namespace is
Mono.Data.SqliteClient, and within this there are classes such as:

SqliteConnection
SqliteCommand
SqliteDataReader
etc

My first instinct is to add new classes in the same namespace:

SqliteConnection3
SqliteCommand3
SqliteDataReader3
etc

This way, you can use the version 2.x and 3.x clients side by side. However,
another approach is to create a new namespace, say Mono.Data.SqliteClient3,
and stick with the old class names. Or to have a new namespace *and* new
class names.

Is there any guidance as to what is best practice here, either for ADO.NET
or for .NET generally?

Tim
 
This way, you can use the version 2.x and 3.x clients side by side.
However, another approach is to create a new namespace, say
Mono.Data.SqliteClient3, and stick with the old class names. Or to have a
new namespace *and* new class names.

Is there any guidance as to what is best practice here, either for ADO.NET
or for .NET generally?

I've been pointed to the latest development code for this client, which has
the beginnings of Sqlite 3.0 support and uses the same classes, with a
version number in the connection string. I guess this is the most convenient
way, although there's some work needed because the current code doesn't take
advantage of the new features in Sqlite 3.0. I am still wondering whether a
distinct set of classes would be better.

Tim
 
Back
Top