Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gambuzino (4517)

gambuzino
  (email not shown publicly)
http://nunonunes.org/
Yahoo! ID: gambuzinix (Add User, Send Message)
Jabber: gambuzino@jabber.org

Journal of gambuzino (4517)

Friday May 13, 2005
04:32 PM

More thoughts on Flickr API

[ #24675 ]

After some more thought (nothing like a bad day to get your brain working in the background...) I came to this conclusions about the classes and namespaces that make sense for the Perl Flickr API.

First I think there really is room for the two sets of modules/classes I discussed: a lower level one which simply models the published Flickr API directly on Perl structures of hashes and arrays, and a higher level one which models the "logical" level of users, photos, photosets, etc.

Then I seem to have reached a reasonable naming structure for them. My current plan goes along these lines:

The lower-level API-mapping classes

These should go into the Flickr::API namespace and should be named following the Flickr API's naming convention, namely there should be the following classes:

  • Flickr::API::People
  • Flickr::API::Photos
  • Flickr::API::Photosets
  • Flickr::API::...

Each of these classes should then implement the functions that are published on the API, for instance Flickr::API::Photos::getInfo(), Flickr::API::Photos::search() and so on.

The higher-level concepts-mapping classes

Then there are the classes which map concepts such as a user or a photo. As I described in the previous post, these objects should rely on the previous ones to manage the communication with Flickr for them and should implement a representation of all the information that Flickr has on each item.

The way I see it now, the namespace for these objects should be the base Flickr namespace itself and there should exist the following classes:

  • Flickr::Person
  • Flickr::Photo
  • Flickr::Photoset
  • Flickr::...

I've already started writing some code, mainly the tests (aren't I a good little programmer?) and even though I will be away for the weekend on a small family gathering I'll try and have something done by monday when I'll have Internet access again and can try out my code on live data.

(This entry is cross-posted from my personal weblog at http://nowhereland.nunonunes.org/archives/2005/05/more_thoughts_o.html)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.