pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus KARG <markus@headcrashing.eu>
To: 'List' <pgsql-jdbc@postgresql.org>
Subject: Re: Pre-processing during build
Date: Wed, 17 Jun 2015 23:02:44 +0200
Message-ID: <006901d0a940$f525a330$df70e990$@eu> (raw)
In-Reply-To: <CAB=Je-HkWY+BH0ZiDVSkkop-V5MYKfHGsVO7MQfpkcJi-c+9cA@mail.gmail.com>
References: <000c01d0a7b6$97571ee0$c6055ca0$@eu>
	<CADK3HHK9TUug9amtabv1a+27u_bb31FCsLBarWsPv_PD12JCcw@mail.gmail.com>
	<CAB=Je-FC6NE7z=OMpfGRyOPk--Fw6Uci9iFbu+JQ1THfeuhgHA@mail.gmail.com>
	<CADK3HHJo=bjA9z=ZBzk-vqxfu+0Eh4UmLd0WJUhngKAVYogz8w@mail.gmail.com>
	<005101d0a86a$f18ffe90$d4affbb0$@eu>
	<CAB=Je-G1+7x4LabgB6A4cF_RY0CV1RwbDryFXa0GioB_vg7o=g@mail.gmail.com>
	<60b20bb834cf54db8232239b9c27fcc2@imap.procolix.com>
	<CADK3HHLmYp34yxQzjEuGgsUW4+joghHZf+0FBr44K8i5hXA+BA@mail.gmail.com>
	<ba57c14862b915a79a69de9089df736e@imap.procolix.com>
	<CAB=Je-HbMx0+s_cuMk68P8v9EymT4UM18Y0aJKqnZCiivABfYw@mail.gmail.com>
	<2e15428aa0cf241e6cd9b951ba96140b@imap.procolix.com>
	<5d539d76f4ccb9a59abc57d5d99c4d92@imap.procolix.com>
	<CAB=Je-HkWY+BH0ZiDVSkkop-V5MYKfHGsVO7MQfpkcJi-c+9cA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

I think you not even need reflection, but could simply rely on proxies. Should be faster and do the job faster. http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/reflect/Proxy.html :-)

An official Java SE standard since v1.3, BTW, to prevent further discussions about versions. ;-)

-Markus


-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Vladimir Sitnikov
Sent: Mittwoch, 17. Juni 2015 14:04
To: Mark Rotteveel
Cc: List
Subject: Re: [JDBC] Pre-processing during build

>So getting this to work would need some form of reflection (to get the
right type at runtime based on the Java version)

Reflection is sufficient, isn't it?

I think reflection would be rather clean solution here.
It is more IDE-friendly and developer-friendly than pre-processing.
Reflection is much easier to debug than byte-code generation.

So, do you see drawbacks with using reflection to select the specific
implementation?

From implementation point of view it just replaces "preprocessing"
with some "Class.forName" and that is it.
It even allows to ship the same jar file and select implementation on the fly.

Vladimir


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



-- 
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 (92+ messages)  latest in thread

Message-ID: <006901d0a940$f525a330$df70e990$@eu>
Permalink:  ../006901d0a940$f525a330$df70e990$@eu/
Also on:    postgresql.org/message-id/006901d0a940$f525a330$df70e990$@eu

 · 

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: markus@headcrashing.eu
  Subject: Re: Pre-processing during build
  In-Reply-To: <006901d0a940$f525a330$df70e990$@eu>
  References: <000c01d0a7b6$97571ee0$c6055ca0$@eu> <CADK3HHK9TUug9amtabv1a+27u_bb31FCsLBarWsPv_PD12JCcw@mail.gmail.com> <CAB=Je-FC6NE7z=OMpfGRyOPk--Fw6Uci9iFbu+JQ1THfeuhgHA@mail.gmail.com> <CADK3HHJo=bjA9z=ZBzk-vqxfu+0Eh4UmLd0WJUhngKAVYogz8w@mail.gmail.com> <005101d0a86a$f18ffe90$d4affbb0$@eu> <CAB=Je-G1+7x4LabgB6A4cF_RY0CV1RwbDryFXa0GioB_vg7o=g@mail.gmail.com> <60b20bb834cf54db8232239b9c27fcc2@imap.procolix.com> <CADK3HHLmYp34yxQzjEuGgsUW4+joghHZf+0FBr44K8i5hXA+BA@mail.gmail.com> <ba57c14862b915a79a69de9089df736e@imap.procolix.com> <CAB=Je-HbMx0+s_cuMk68P8v9EymT4UM18Y0aJKqnZCiivABfYw@mail.gmail.com> <2e15428aa0cf241e6cd9b951ba96140b@imap.procolix.com> <5d539d76f4ccb9a59abc57d5d99c4d92@imap.procolix.com> <CAB=Je-HkWY+BH0ZiDVSkkop-V5MYKfHGsVO7MQfpkcJi-c+9cA@mail.gmail.com> <006901d0a940$f525a330$df70e990$@eu>

* 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