Re: Pre-processing during build

Поиск
Список
Период
Сортировка
От Markus KARG
Тема Re: Pre-processing during build
Дата
Msg-id 006901d0a940$f525a330$df70e990$@eu
обсуждение исходный текст
Ответ на Re: Pre-processing during build  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Ответы Re: Pre-processing during build  (Mark Rotteveel <mark@lawinegevaar.nl>)
Список pgsql-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



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Markus KARG"
Дата:
Сообщение: Re: Pre-processing during build
Следующее
От: "Markus KARG"
Дата:
Сообщение: Re: Pre-processing during build