Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAL6R-0003A9-20 for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Jul 2015 16:43:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZAL6Q-00089o-Gw for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Jul 2015 16:43:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZAL6N-00088D-3C for pgsql-jdbc@postgresql.org; Wed, 01 Jul 2015 16:43:11 +0000 Received: from smtprelay02.ispgateway.de ([80.67.31.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZAL6J-0001jP-9G for pgsql-jdbc@postgresql.org; Wed, 01 Jul 2015 16:43:10 +0000 Received: from [88.66.22.56] (helo=Zauselmaus) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from ) id 1ZAL6H-00075L-Vd for pgsql-jdbc@postgresql.org; Wed, 01 Jul 2015 18:43:06 +0200 From: "Markus KARG" To: "'List'" References: <558F22BE.5050508@8Kdata.com> <558F377B.7040606@8Kdata.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> <559243A5.4020708@8Kdata.com> <55927EA6.2050905@8Kdata.com> <55931A07.6000103@8Kdata.com> In-Reply-To: Subject: Re: SQLJSON Date: Wed, 1 Jul 2015 18:43:07 +0200 Organization: Markus KARG, Staatl. gepr. Inf. Message-ID: <002401d0b41d$028905d0$079b1170$@eu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0025_01D0B42D.C611D5D0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdCzkU70fHz4uTuiRjugBfQ+mS3ymAAi6w/Q Content-Language: de X-AVK-Virus-Check: AVA 25.2250;789163EA X-AVK-Spam-Check: 1; str=0001.0A0C0204.55941899.0223,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0; F1206 X-Df-Sender: bWFya3VzQGhlYWRjcmFzaGluZy5ldQ== X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. ------=_NextPart_000_0025_01D0B42D.C611D5D0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable +1 =20 From: pgsql-jdbc-owner@postgresql.org = [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Vitalii Tymchyshyn Sent: Mittwoch, 1. Juli 2015 02:02 To: =C3=81lvaro Hern=C3=A1ndez Tortosa; Vladimir Sitnikov Cc: List; Stephen Nelson Subject: Re: [JDBC] SQLJSON =20 As for me it should not be required unless user explicitly asks for it = with two-params getObject. Single param must not be changed as this = would break backward compatibility. Or it can be controlled with a uri = param, but I'd say default should be to return String until after new = version of JDBC says otherwise. =20 Actually, I'd vote for pluggable converters for any class for two-param = getObject. For JSON some of them could be prebundled, like for JSR and = Jackson. Note that JSR or Jackson itself should not be included. Also user should be able to write his own converter and to specify what = to use by default for single-param getObject. =20 Best regards, Vitalii Tymchyshyn =D0=92=D1=82, 30 =D1=87=D0=B5=D1=80=D0=B2. 2015 =D0=BE 18:36 =C3=81lvaro = Hern=C3=A1ndez Tortosa =D0=BF=D0=B8=D1=88=D0=B5: To you and I, we know that JsonValue is a JSR353 standard and hence = a external dependency and hence an action to add to the classpath is = required. A given user might not be aware that JsonValue is a standard, and = it's reasonable to think it is a Pg-specific class and thus you'd expect = it to be bundled with the driver. Indeed, it sounds weird that you need = extra dependencies to process objects returned by the driver. I'd always = expect the driver to contain all the code to work with it! If JsonValue would be an own class, would we also tell the user = "grab an external dependency too"? I don't think so. Then, why does the = user need to care about that? I think this should be abstracted away for = the user. Regards, =C3=81lvaro --=20 =C3=81lvaro Hern=C3=A1ndez Tortosa =20 =20 ----------- 8Kdata =20 =20 On 01/07/15 00:30, Vitalii Tymchyshyn wrote: I dont understand how users can "not realize they need another = dependency" if their application is going to use Json. How they think they are going to use it without having it in classpath? Best regards, Vitalii Tymchyshyn =20 =D0=92=D1=82, 30 =D1=87=D0=B5=D1=80=D0=B2. 2015 07:34 =C3=81lvaro = Hern=C3=A1ndez Tortosa =D0=BF=D0=B8=D1=88=D0=B5: 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, =C3=81lvaro -- =C3=81lvaro Hern=C3=A1ndez 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 =20 ------=_NextPart_000_0025_01D0B42D.C611D5D0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

+1

 

From:= = pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] = On Behalf Of Vitalii Tymchyshyn
Sent: Mittwoch, 1. Juli = 2015 02:02
To: =C3=81lvaro Hern=C3=A1ndez Tortosa; Vladimir = Sitnikov
Cc: List; Stephen Nelson
Subject: Re: = [JDBC] SQLJSON

 

As for = me it should not be required unless user explicitly asks for it with = two-params getObject. Single param must not be changed as this would = break backward compatibility. Or it can be controlled with a uri param, = but I'd say default should be to return String until after new version = of JDBC says otherwise.

 

Actually, I'd vote for pluggable converters for any = class for two-param getObject. For JSON some of them could be = prebundled, like for JSR and Jackson. Note that JSR or Jackson itself = should not be included.

Also user should be able to write his own converter = and to specify what to use by default for single-param = getObject.

 

Best regards, Vitalii = Tymchyshyn

=D0=92=D1=82, 30 = =D1=87=D0=B5=D1=80=D0=B2. 2015 =D0=BE 18:36 =C3=81lvaro Hern=C3=A1ndez = Tortosa <aht@8kdata.com> = =D0=BF=D0=B8=D1=88=D0=B5:


    To you and I, we know that = JsonValue is a JSR353 standard and hence a external dependency and hence = an action to add to the classpath is required.

    = A given user might not be aware that JsonValue is a standard, and it's = reasonable to think it is a Pg-specific class and thus you'd expect it = to be bundled with the driver. Indeed, it sounds weird that you need = extra dependencies to process objects returned by the driver. I'd always = expect the driver to contain all the code to work with = it!

    If JsonValue would be an own class, would = we also tell the user "grab an external dependency too"? I = don't think so. Then, why does the user need to care about that? I think = this should be abstracted away for the user.




    = Regards,

    = =C3=81lvaro



-- =
=C3=81lvaro Hern=C3=A1ndez =
Tortosa
 
 
-----------
8Kdata
=
 

 

On 01/07/15 00:30, Vitalii Tymchyshyn = wrote:

I dont understand how = users can "not realize they need another dependency" if their = application is going to use Json.
How they think they are going to = use it without having it in classpath?

Best regards, = Vitalii Tymchyshyn

 

=D0=92=D1=82, 30 =D1=87=D0=B5=D1=80=D0=B2. 2015 = 07:34 =C3=81lvaro Hern=C3=A1ndez Tortosa <aht@8kdata.com> = =D0=BF=D0=B8=D1=88=D0=B5:


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@8= Kdata.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,

    =  =C3=81lvaro


--
=C3=81lvaro Hern=C3=A1ndez = 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<= /o:p>

 

------=_NextPart_000_0025_01D0B42D.C611D5D0--