cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: the first basic OO perl interface

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 22 Sep 2001 12:26:25 +0200 (MET DST)

On Sat, 22 Sep 2001, Cris Bailiff wrote:

> I'd like to include the OO interface and Curl_easy into one perl
> package. People shouldn't really need 2 packages for this extra
> functionality.

That's true.

> I'd like to think through the naming issues to see what the implications
> for package, function and directory names are. Are you happy with the
> name 'Curl' as the object class?

Well, we need to follow the general perl naming rules of course. 'Curl' would
be fine with me. Or perhaps something like 'Pcurl' to make it slightly
different from the tool named curl.

> If so, the .pm file name should be 'Curl.pm' and then you should 'use
> Curl'. (Class names and File names should match, and classes are
> 'Captialized::By::Perl::Convention'. We can/should roll 'Curl' and
> 'Curl_easy' into one package, but it would then be called
> 'Curl-x.x.x.tar.gz', not 'Curl_easy' (as the top of the namespace).

The 'easy' stuff made sense once upon a time, but since libcurl took the turn
to not introduce any other interface, it doesn't really make sense to call it
'curl::easy'. I've even been planning to cut off the 'easy' part from the
libcurl functions.

> (Also, CPAN generally tries to name things a bit more hierarchically, so
> it would be good to plan that now - for example, would you object to
> 'Net::Curl' instead? (Also pre-avoids the 'curl' language interface
> debate, unless you'd like to get in and claim the namespace early :-)
> )...

Nah, Net::Curl sounds very reasonable to me.

> I've got some more sample 'OO' code written by one of our guys here -
> (Curl::OO) - which is similar to yours but has a few more methods. We
> haven't 'released' it because its needs a bit more work (generalization,
> naming issue...) to be of general use, but I can post it as another
> example.
>
> I'd be happy to roll these beginnings into the start of a more fully
> featured 'Curl' package - you're succeeding in goading me into addressing
> this part of the interface asap..

:-)

> I don't want to 'take over' the OO part, or discourage your work, I just
> want to make sure we get a 'unified' result, and don't commit to an
> inflexible interface early on - the right OO interface could be really
> good.... I'd suggest you read 'perldoc perlmodlib' and then use 'h2xs' to
> make a skeleton package if you'd like to make the current code look more
> 'real'.

I would be very happy to have you 'take over' the OO part. I already have
quite a load, and I wouldn't really be able to maintain the OO interface
anyway. I wanted to write one up for fun to learn how to make one, and to get
the work on a OO perl interface started.

That's also why I ask you about this, I think of you as the main 'perl
interface man' for the curl project! ;-)

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-22