Chris:

I'm not sure of the best answer here, though I do know that top-level
namespaces (like Vimeo::API) are generally frowned upon.

A cursory search of "API" turns up:

- WWW::Facebook::API
- WWW::Bebo::API

As the first two results. On the other hand, some people have used the
namespace WebService:: for this sort of thing. Personally I'd go for
WWW::Vimeo.

Oh, as an aside, I think the general recommendation is to instantiate
objects as: WWW::Vimeo->new rather than the new keyword. I think this
has to do with making the call less ambiguous, since you are making it
obvious that you are calling a Class method rather than a subroutine
with a bareword as a parameter. There's probably something about that
in Perl Best Practices :-)

Hope this helps.

Cheers,

Jonathan

On Tue, Mar 10, 2009 at 9:57 AM, Chris Vertonghen <c...@dimolto.com> wrote:
> Hello all,
>
> I'm writing a module that I dubbed "Net::Vimeo::API" for now. It's
> rather self-explanatory, but just to make sure: it's supposed to be a
> perl module for interfacing with the full Vimeo API (www.vimeo.com). I
> am thinking about publishing it on CPAN.
>
> It roughly goes something like this:
>
> use Net::Vimeo::API;
>
> my $api = new Net::Vimeo::API({'key'    => 'your_api_key',
>                               'secret' => 'your_shared_secret'});
>
> my $response = $api->execute_method('vimeo.test.echo', {
>  'foo' => 'bar',
>  'baz' => 'quux',
> });
>
> Now, I am writing to the list to ask about the namespace. Is it ok if
> I name it Net::Vimeo::API or would it be more appropriate to name it
> something else like Vimeo::API or WWW::Vimeo::API?
>
> Your input is much appreciated.
>
> Best,
> Chris.
>
> --
> Chris Vertonghen
> http://friendfeed.com/cvertonghen
>

Reply via email to