Hi Witold ;-)

2013/4/7 Witold Szczerba <[email protected]>:
>
> On 6 April 2013 23:30, Lukas Eder <[email protected]> wrote:
>>
>>
>> 2013/3/30 Christopher Deckers <[email protected]>:
>>
>>
>> > When someone uses a Configuration, I believe that the purpose is to not
>> > repeat parameters, to have the same parameters for all Executors. In
>> > some
>> > cases, which I think are limited, someone could have more than one
>> > Configuration, but would still use those as shared parameters for sets
>> > of
>> > Executors. The purpose of this e-mail is to suggest strengthening this
>> > notion of Configuration as a global shareable set of parameters.
>>
>> Yes, I agree with that, too. While it is a good use-case to create
>> ad-hoc configurations through what you called "ad-hoc parameters", in
>> the long run, users will reuse mostly a single, global Configuration.
>>
>
> Hi again,
> I know it may sound boring, you may have enough of me on that subject
> already, so I promise this is my last attempt to try to convince you that:
>
> ****
> Sharing a configuration object across entire application just to be able to
> get an Executor in return, is an anti-pattern, it is evil and every time
> when someone suggest to do so, an innocent kitten dies.
> ****

I'm not convinced yet. But not because I "strongly believe" that the
current solution is perfect, I might just (still!) not understand your
point of view. Let's put it this way:

// jOOQ 2.x:
new Factory(...).select();

// jOOQ 3.0-RC1 and RC2:
new Executor(...).select();

// jOOQ 3.0-RC3
DSL.using(...).select();

They're exactly the same, so I think I haven't introduced something
new, right? Or are you talking about the fact that now, using(...) is
overloaded such that a Configuration object can be passed to it -
which wasn't possible before? The relation between XX and
Configuration was this:

jOOQ 2.x: Factory implements Configuration
jOOQ 3.0-RC1 and RC2: Executor implements Configuration
jOOQ 3.0-RC3: DSLContext "has-a" Configuration

So, in my opinion, things haven't changed fundamentally between 2.x
and 3.x. But things have gotten better / easier for those that argue
that a "configuration" is a global, thread-safe thing, given that I
follow Christopher's advice on this thread. But you don't have to make
"configuration" a global thing. You can choose the configuration
instance's scope yourself.

So, where exactly am I still wrong? Can you explain without resorting
to kittens?

> Thanks, and I am sorry for inconvenience. I just had to be sure I did
> everything I could, to let you know about this, and to stop you from
> polluting the beautiful JOOQ DSL with that "using(configuration)" thing. I
> do respect your right to do as you will and I am grateful I can still just
> separate the creation of Executor instances (I hope you will continue to
> provide an interface for this as it was in 2.x).

Yes, DSLContext is now an interface. It was probably a bad idea to
make RC1 / RC2's Executor a class.

> The only inconvenience for
> me is that I will have to explain to everyone in my projects that using
> DSL#using is forbidden, please declare a dependency on Executor if you want
> to use it, but it is extremely low price for this great product.

Thanks. Maybe you will end up by liking this part, too :-)

Cheers
Lukas

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to