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 13:33:58 +0200
Message-ID: <55927EA6.2050905@8Kdata.com> (raw)
In-Reply-To: <CAB=Je-EHCfpPGqfmmAYFnu=FwE9jTH6y_=OWBz1XdYZSeOve+Q@mail.gmail.com>
References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com>
	<000601d0b125$17d3fee0$477bfca0$@eu>
	<CAH7T-arHGk_tyJZkJjubBVmip_FY5NR7xkquVTGwN5FLWxkqnA@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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>


On 30/06/15 09:57, Vladimir Sitnikov wrote:
>>   so that you don't need to parse it manually, which is a pain for many users
> A) Can you please list pain points in literal?

     I did that already: 
http://www.postgresql.org/message-id/558FC12E.8010107@8Kdata.com

     In brief: users don't realize they need another dependency. Then 
they find their code breaks with a RuntimeException. Frustration 
appears, and there is no compelling reason not to have the dependency in 
the driver. User gets angry. I agree with the user anger.

     Imagine JSR353 wasn't an external class. Imagine the driver wanted 
to return a PGJsonValue class. Now you compile the code and then remove 
the .class from the JAR file. The end result is more or less the same: 
hey, to use this driver you have to anyway include another dependency. 
Which is weird: a dependency on something you are returning......

     But again: *what* is the problem adding this dependency? Classpath 
collision is extremely unlikely, I won't bet on it, so why not help the 
user even more? Why not make it more user friendly, why do we prefer 
less user friendly?


> I think we've already agreed that "having readme" is good enough so
> even newbies can add dependencies.
     I don't agree is good enough. Good enough is not needed to add 
anything else. Or not asking the user to do something we could have 
provided instead with 0 drawbacks.

> What are the other pain points except "need to add a couple of jars if
> json is needed"?
>
> Frankly speaking, I find current "different jdbc version jars" even
> more confusing than "if you want json, add pgjdbc-json dependency".

     Multiple-jars would be for experienced user who would like to 
override the RI. Everybody else would be happy with the default one. I 
wouldn't call it "multiple JARs", just an "expert" JARs for those who 
have that unfrequent needs.

>
>> so that you don't need to parse it manually,
> B) That does not work that way.
> Can you suggest a piece of "user code" you have in mind?
>
> Let me predict it a bit:
> 1) It processes resultset
> 2) Fetches "JsonValue"
> 3) Passes to a business-logic class
>
> We can stop here.
> "business logic class" from #3 will definitely have "JsonValue"
> classes in its method signatures.

     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.


> In other words, it would require to have "javax.json" API in the class
> path to compile.
>
> Then I would love to know how is the user addressing that without
> adding "javax.json" API dependency to her build system of choice.
>
> The same business logic should be unit-tested (without DB), shouldn't it?
> That results in "it should be testable without pgdjbc dependency".

     As I said, it doesn't need to. So if you *also* have JSON at your 
business-logic then yes, you need the API on your classpath. But that's 
obvious :)
>
> C) If we continue creating bundles here and there (not sure what is
> "non offensive" wording here), the number of possible bundles would
> explode exponentially. jdbc driver is not an application for end-user,
> so I do not see much reason why it should "bundle optional
> dependencies without shading them".
>
> For instance, if we decide to use objectweb.asm bytecode transformer,
> it would be perfectly fine to shade it into org.postgresql.asm...
> package, so it is not exposed to public.
>
> However, with javax.json you cannot do package renaming since it would
> make no sense.

     Right. So there's one bundle (JDBC+API+shaded RI) and another just 
with JDBC, for people that don't want Json and want to save 96Kb on 
their Jars or "expert" people that want to override the RI. That's it. 
2. That's not an exponential explosion.

>
> D) Theoretically, we could represent json as java.util.Map /
> java.util.List by embedding and repackaging some json implementation,
> however I am not sure if that makes much sense provided JSR353 defines
> proper interfaces.
     Yeah, I don't think that makes sense.

     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: <55927EA6.2050905@8Kdata.com>
Permalink:  ../55927EA6.2050905@8Kdata.com/
Also on:    postgresql.org/message-id/55927EA6.2050905@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: <55927EA6.2050905@8Kdata.com>
  References: <CADK3HH+RBjfo7gp3k-DSZYiZ-qS1BcS-OjG3xAgJhJDHbkgo_Q@mail.gmail.com> <CAH7T-arHGk_tyJZkJjubBVmip_FY5NR7xkquVTGwN5FLWxkqnA@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>

* 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