commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Speirs <wspe...@apache.org>
Subject Re: [DBUTILS] Updates for v2.0
Date Tue, 08 Jan 2013 01:55:11 GMT
>
> If the entire API is to change, then I agree one might as well treat
> it as a completerly new library and change groupId/package name.
> Users could either stick with the current design or rewrite to use the
> new design.
>

I guess the question is, are you in favor of changing a great deal of the
API to add named parameters? Currently the major benefit of DBUtils is that
you don't have to clean-up after yourself. This would add a second and very
major selling point: you don't have to count questions marks to line-up
parameters.


> The risk is that some end-users won't want to switch, and may drift
> way from the orginal library if it is not being maintained.
>

There isn't much being done to DBUtils currently, and I don't think people
are walking away from it because it's not maintained. If people are leaving
DBUtils -- I would guess -- it's because they're going after something more
powerful like Hibernate, and DBUtils was never meant to compete with the
likes of Hibernate.


> But if the intent is only to add some new elements to the API, doing
> so in an incremental, binary-compatible way would allow endusers much
> more flexibility in upgrading.
>

I agree that adding features in a binary-compatible way is always the
preference. What makes me nervous is now we'll have a whole slew of
deprecated methods in QueryRunner which looks ugly and can be confusing to
someone new. There are already 4 versions of the query method that are
deprecated, and this would potentially add 4 more! My proposal would be to
eliminate all of them in v2.x and add just a single query method with bind
methods that can be called on the returned object.


> It would be useful to show some examples of how the fluent style
> compares with the existing style before proceeding.
>
> At the moment I'm not convinced that it would be a major benefit.


Beyond the examples I gave before, what would you like to see?

I'm not saying we HAVE to use the fluent style (although I do like it), but
I would really like to see named parameters in DBUtils. For smaller
projects I still use the library, but it drives me nuts when I have to
modify an SQL query and then play the counting game with the question marks
to make sure I'm passing all the right parameters in order. The major
benefit of this update would be to add named parameters (in a fluent or
otherwise fashion).

Thanks again!

Bill-

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message