cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl java interface on linux

From: M Biswas <m.biswas_at_cleartool.com>
Date: Fri, 08 Aug 2003 13:51:18 -0400

Daniel Stenberg wrote:
> On Fri, 8 Aug 2003, Mohun Biswas wrote:
>
>>why choose a JNI solution over, say, Jakarta HttpClient
>>(http://jakarta.apache.org/commons/httpclient/) which is pure Java? I'm not
>>writing Java code, at least not on the client side, and thus haven't
>>investigated either solution personally. So this is not flamebait but rather
>>an honest question which I ask on behalf of those who are doing client-side
>>Java HTTP.
>
>
> I can think of a few different reasons:

Right, but for the most part what you give are *possible* reasons that
one might be better than the other. I was hoping that someone - more
likely to be the person just starting a JNI libcurl interface than you,
who by your own account are "not a java guy" - would know of some actual
reasons. Vide infra:

> 1. Speed. libcurl is bound to be faster than pure java solution, especially
> if you're using SSL.

Likely true though unproven AFAIK. On the other hand, anyone choosing
Java has ipso facto chosen portability and type-safety and OO and all
the other Java features over pure performance - if speed was their main
motivation they'd be writing in C anyway. Of course their are many
possible complicating factors here and speed is certainly a valid reason.

> 2. Features. I have no idea what stuff that "HttpClient" supports, but perhaps
> libcurl does things it doesn't?

Or vice versa... Certainly ftp and other non-http protocols are a point
for libcurl.

> 3. Personal preference. Or license condtions. Or quality of code. Or feedback
> on support questions. Or the spirit of the development community. Or that
> it sounds cooler. Or that you're up for the challange.

Well, FWIW the license conditions for all Apache software are quite
similar to that of cURL. The other reasons are perfectly 'reasonable'
but also suppositional.

> I don't point fingers and tell people what to do or what to choose. I know
> many people continue to ask about a java binding for libcurl, so I figure
> there must be some good reasons for these people.

Of course, and I didn't expect you (or anyone) to tell people what to
do. Nor could one reasonably expect them to do it anyway. The question
(rephrased) is: does anyone know of a quantifiable reason to prefer one
over the other? Because the general rule of Java is that, all things
being equal, JNI is deprecated. Ergo all things must not be equal. So
what are they? I guess Christian would be the logical person to know the
answer.

> Again, I'm not a java guy so I may be totally out of my league here. Feel free
> to ignore me.

I certainly don't want to ignore you, and I really am not trying to get
into a finger-pointing exercise. It's just that the existence of your
"old" Java binding might be explainable as (a) a proof of concept or (b)
the lack of a pure-Java alternative at the time. The news that someone
is working on a new binding, however, argues that either (a) he's
unaware of HttpClient or (b) libcurl offers something that it doesn't.
In the latter case, it would be nice to know what those features are.

MB

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-08