You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Moandji Ezana <mw...@gmail.com> on 2012/02/07 22:46:56 UTC
[DbUtils] Could AsyncQueryRunner be a wrapper around a QueryRunner?
I noticed that AsyncQueryRunner duplicates much of the code from
QueryRunner. Would it be possible for AsyncQueryRunner to simply decorate a
QueryRunner with async functionality? For example, pass in a QueryRunner
instance in the constructor and delegate the methods to it.
This would reduce the amount of code duplication and ease future API
extensions. Are there issues I'm overlooking?
Moandji
Re: [DbUtils] Could AsyncQueryRunner be a wrapper around a QueryRunner?
Posted by Simone Tripodi <si...@apache.org>.
Hi Moandji,
the ML is not the right place where attaching patches, can you please
fill an issue on JIRA?
TIA!
-Simo
http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/
On Sat, Feb 11, 2012 at 8:53 AM, Moandji Ezana <mw...@gmail.com> wrote:
> On Wed, Feb 8, 2012 at 5:04 AM, William Speirs <ws...@apache.org> wrote:
>>
>> This is not a bad idea, but I would need to give it more thought.
>>
>> I tried to reduce code dup when I created AsyncQueryRunner by creating
>> AbstractQueryRunner[1], could we just add more code to that class?
>
>
> I was thinking of having the AsyncQueryWrapper decorate the QueryRunner with
> async behaviour, in the same way a BufferedInputStream might decorate an
> InputStream.
>
> Here's a patch that shows what I mean. It causes all the interaction-based
> tests to fail, but I just wanted to get your take on whether this was a
> good/feasible idea.
>
> Moandji
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [DbUtils] Could AsyncQueryRunner be a wrapper around a QueryRunner?
Posted by Moandji Ezana <mw...@gmail.com>.
On Wed, Feb 8, 2012 at 5:04 AM, William Speirs <ws...@apache.org> wrote:
> This is not a bad idea, but I would need to give it more thought.
>
> I tried to reduce code dup when I created AsyncQueryRunner by creating
> AbstractQueryRunner[1], could we just add more code to that class?
>
I was thinking of having the AsyncQueryWrapper decorate the QueryRunner
with async behaviour, in the same way a BufferedInputStream might decorate
an InputStream.
Here's a patch that shows what I mean. It causes all the interaction-based
tests to fail, but I just wanted to get your take on whether this was a
good/feasible idea.
Moandji
Re: [DbUtils] Could AsyncQueryRunner be a wrapper around a QueryRunner?
Posted by William Speirs <ws...@apache.org>.
This is not a bad idea, but I would need to give it more thought.
I tried to reduce code dup when I created AsyncQueryRunner by creating
AbstractQueryRunner[1], could we just add more code to that class?
[1]
http://commons.apache.org/dbutils/apidocs/org/apache/commons/dbutils/AbstractQueryRunner.html
Bill-
On Feb 7, 2012 4:47 PM, "Moandji Ezana" <mw...@gmail.com> wrote:
> I noticed that AsyncQueryRunner duplicates much of the code from
> QueryRunner. Would it be possible for AsyncQueryRunner to simply decorate a
> QueryRunner with async functionality? For example, pass in a QueryRunner
> instance in the constructor and delegate the methods to it.
>
> This would reduce the amount of code duplication and ease future API
> extensions. Are there issues I'm overlooking?
>
> Moandji
>