pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Hernández Tortosa <aht@8Kdata.com>
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Cc: Stephen Nelson <stephen@eccostudio.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: SQLJSON
Date: Tue, 30 Jun 2015 14:19:12 +0200
Message-ID: <55928940.6060209@8Kdata.com> (raw)
In-Reply-To: <CAB=Je-Ho_t_TqFedDf-WF+qsJidQZGaix=g5rOWHS_xXu5=4Cg@mail.gmail.com>
References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com>
	<558F22BE.5050508@8Kdata.com>
	<CAH7T-aoBTDQncoodf6N4LfdKE7si7oRrNp1FeRjz2wL5UHrV8g@mail.gmail.com>
	<558F377B.7040606@8Kdata.com>
	<CAHL_zcNbBhYh186q6sMdoG59BB8zhW3TG2s_Prnts3yuJzNQRA@mail.gmail.com>
	<558FC12E.8010107@8Kdata.com>
	<000301d0b187$aeb51a30$0c1f4e90$@eu>
	<558FC4E1.7020005@8Kdata.com>
	<001301d0b1b4$7f0862b0$7d192810$@eu>
	<5590458C.3040805@8Kdata.com>
	<002901d0b288$52a8e080$f7faa180$@eu>
	<5591960B.7070406@8Kdata.com>
	<007c01d0b2a3$9614bfe0$c23e3fa0$@eu>
	<5591ADFD.8000304@8Kdata.com>
	<000301d0b2b4$042a41c0$0c7ec540$@eu>
	<5591C898.8090102@8Kdata.com>
	<CAB=Je-H-tgJ-hGUqWk83A4M7mheBELGUXKj2qe4ECbVPeyaebA@mail.gmail.com>
	<CAHpHs3kMk7ykZg=KgB-j5_qHfg7JjDubJNhgJQFCs5eTzuL0tQ@mail.gmail.com>
	<559243A5.4020708@8Kdata.com>
	<CAB=Je-EHCfpPGqfmmAYFnu=FwE9jTH6y_=OWBz1XdYZSeOve+Q@mail.gmail.com>
	<55927EA6.2050905@8Kdata.com>
	<CAB=Je-Ho_t_TqFedDf-WF+qsJidQZGaix=g5rOWHS_xXu5=4Cg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>


On 30/06/15 14:03, Vladimir Sitnikov wrote:
>> you need the API on your classpath. But that's obvious :)
> Do you know of https://en.wikipedia.org/wiki/Principle_of_least_astonishment?
> I would call an "astonishment" if my jdbc driver provided "javax.xml"
> or "javax.json" or "java.util.concurrent" kind of packages.
> Don't you think so?

     Bad examples. Both javax.xml and j.u.c. are already in JRE. I would 
expect javax.json to be too, but it's not. However, it's a compile 
dependency and hence I don't see how it would violate this principle.

>
>> users don't realize they need another dependency.
> This is trivially resolved via readme. Come on.
> If a developer can't figure out he needs "a library for json", why do
> we care to support such a developer?

     We should care about all, not become elitists. There are many cases 
where you don't run through the documentation, but expect that something 
works out-of-the-box.

>
> Consider the following section in _current_ readme:
>
>> Currently Waffle-JNA and its dependencies are required for SSPI authentication support (only supported on a JVM running on Windows). >Unless you're on Windows and using SSPI you can leave them out when you install the driver.
> So, there already exists a case when optional dependency is
> recommended in readme. This might be improved in terms of "ready for
> use mvn dependency tags", however it does not follow "bundle
> everything" approach.

     Good. I think that could possible be improved, too :)

>
>> Classpath collision is extremely unlikely, I won't bet on it, so why not help the user even more?
> http://wiki.osgi.org/wiki/Split_Packages
> Google finds 124000 results for "osgi split package".
>
> Is that enough to stop embedding non-renamed packages?
>
> The problem is not specific to OSGi. OSGi just highlights it.
>
> Well, I guess it somehow can be not that convincing, so I throw
> another issue on the table:
> https://issues.jboss.org/browse/AS7-3305 (~
> http://www.nightprogrammer.org/development/hints/illegalaccesserror-packages-classloaders/
> )

     I am well aware of the problem. But I am not speaking from a 
general perspective, but rather on a very specific case: a collision 
would only happen if JSR353 is ever changed. I believe if that happens 
is to embed it into JRE, and that will then require changes to the 
driver anyway. So if the API is not embedded, then we are preventing a 
problem that will very likely never occur. So why bother? (and if it 
did, it would be as simple as doing a new driver release without the 
dependency..... not a big deal)

>
>> we could have provided instead with 0 drawbacks
> Could you please reconsider that?
     As I said, I think the drawback is a very unlikely event, easily 
solvable. And it helps a lot everybody, IMHO. Your opinion is different, 
well, I respect that.
>
>> Classpath collision is extremely unlikely
> If the collision happens, we will have no reasonable way of solving that.
> It's better to prevent that collision from the start than develop on a
> minefield.

     An earth-sized minefield with just one mine. I'd take the risk.

     Oh, and if we hit the mine, the way of solving that would be to 
have a new driver version, now without the dependency, when your point 
is proven rather than guessed. Then, I will approve that immediately. 
But until then I'd make life easier for everybody. Otherwise, it's over 
engineering.

>
>> No, it doesn't need to be like that. That you extract a JSON from your database, it doesn't mean that you have to have a JSON on your business logic. Not at all.
> Please provide an example of business logic that extracts json values
> and does not get infected its methods' signatures with json classes.
> I can't follow your justification while you provide zero examples.

     Trivial. Extract values from Json and store in non-json fields, 
transform Json to Maps, you name it. Anything where your business logic 
does not store Json* references.

>
> I hope you do not call "POJO processResultSet(ResultSet rs)" kind of
> method a "business logic".
> It is not testable since it does multiple things: "retrieves jsons and
> performs conversion".
> At least it should be "JsonValue processRow(ResultSet rs)" + "POJO
> convertJsonToPojo(JsonValue)".

     No, I don't.

>
>> That's it. 2. That's not an exponential explosion.
> What do you think about Waffle-JNA then?
> Should it be included in "all in one" bundle?
> Should pgjdbc have "core", "core+waffle", "core+json", "core+waffle+json" jars?
> It is exactly what I call "exponential explosion".

     Honestly, I'm speaking about Json now, which is a widespread 
request. I'm not that sure about waffle, it should probably be 
considered on a case-by-case basis. In any case, I'm not saying let's do 
a "core" and then "core+json". I would rather say "core" and "core minus 
json", since I see very few reasons not to use the first one.

     All that said: my opinion is clearly there, I will leave the 
decision to the rest of the list and the team. Hope that my 2 cents helped.

     Regards,

     Álvaro


-- 
Álvaro Hernández Tortosa


-----------
8Kdata



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (103+ messages)  latest in thread

Message-ID: <55928940.6060209@8Kdata.com>
Permalink:  ../55928940.6060209@8Kdata.com/
Also on:    postgresql.org/message-id/55928940.6060209@8Kdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: aht@8Kdata.com, sitnikov.vladimir@gmail.com, stephen@eccostudio.com
  Subject: Re: SQLJSON
  In-Reply-To: <55928940.6060209@8Kdata.com>
  References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com> <CAH7T-aoBTDQncoodf6N4LfdKE7si7oRrNp1FeRjz2wL5UHrV8g@mail.gmail.com> <558F377B.7040606@8Kdata.com> <CAHL_zcNbBhYh186q6sMdoG59BB8zhW3TG2s_Prnts3yuJzNQRA@mail.gmail.com> <558FC12E.8010107@8Kdata.com> <000301d0b187$aeb51a30$0c1f4e90$@eu> <558FC4E1.7020005@8Kdata.com> <001301d0b1b4$7f0862b0$7d192810$@eu> <5590458C.3040805@8Kdata.com> <002901d0b288$52a8e080$f7faa180$@eu> <5591960B.7070406@8Kdata.com> <007c01d0b2a3$9614bfe0$c23e3fa0$@eu> <5591ADFD.8000304@8Kdata.com> <000301d0b2b4$042a41c0$0c7ec540$@eu> <5591C898.8090102@8Kdata.com> <CAB=Je-H-tgJ-hGUqWk83A4M7mheBELGUXKj2qe4ECbVPeyaebA@mail.gmail.com> <CAHpHs3kMk7ykZg=KgB-j5_qHfg7JjDubJNhgJQFCs5eTzuL0tQ@mail.gmail.com> <559243A5.4020708@8Kdata.com> <CAB=Je-EHCfpPGqfmmAYFnu=FwE9jTH6y_=OWBz1XdYZSeOve+Q@mail.gmail.com> <55927EA6.2050905@8Kdata.com> <CAB=Je-Ho_t_TqFedDf-WF+qsJidQZGaix=g5rOWHS_xXu5=4Cg@mail.gmail.com> <55928940.6060209@8Kdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox