I'm working on a ColdFusion library for Amazon's SimpleDB, and I'm mulling over the options for how I want the library to work. I've completed the authorization code and the methods that deal with creating, listing, and deleting domains. They exist well as function calls, with the listing method returning a query object for easy iterating.
The two pieces that remain are the methods that deal with items (records within the domain) and queries against a domain. Here are a few options that I have, and I'd love some feedback!
SimpleDB allows you to add attributes to an item and remove them, as well as retrieve all (or a subset) of the attributes of an item.
There are two main approaches here: Present an Item object with methods, or present the methods within the main CFC itself.
Presenting an Item as an object would work like this:
Presenting methods from the main cfc would look like this:
In either case, changes could be queued in the system until persist() or persistChanges() was called. This way, multiple attribute sets could be combined together to speed processing.
The examples I provide here are a bit rough, but I'm sure you get the idea.
Which of these options is going to be more simple / coldfusion like?
The SimpleDB API returns a list of itemnames to queries. This means that to access the data, you need to query the attributes for each item. The simplest option would be to return the list of itemnames, and allow use of the other methods to get the desired attributes.
A more full-featured interface would have the option to get the attributes for each item and form it into a query. An iterator object could be another option, with either attribute access methods or simply returning an item object similar to the one mentioned in the item section.
So, does this rambling question make any sense? Which style (thin and rough, fat and friendly) of API interface do you prefer?
If my thoughts need to be better formed before any worthwhile answer can be given, please let me know.
Chris
I've delayed the project a little bit, although I do have working code. There is a bit of fragmentation between the different Amazon Web Services ColdFusion libraries, and before I put the real polish on what I have, I want to create a group of the other authors and see if we can consolidate them all into one library, with somewhat of a uniform interface shared between them.
If you (@Chris) or anyone else would really like a copy of my code now, then holler, and I'll post it somewhere in it's incomplete state so you can not rebuild what I already have.
http://awsconsole.riaforge.org/
It is also linked from Amazon: http://developer.amazonwebservices.com/connect/ent...
http://www.air-jordan-retro.com
http://www.authentic-air-jordan.com
http://www.airjordan-fusion.com
http://www.air-jordanfusion.com
http://www.air-jordan-jumpman.com
http://www.air-jordan-6ring.com
http://www.nab-net.com
http://www.party-entertainment-blog.com
http://www.shoes-with-toes.com
http://www.clothing-website.com
http://www.fashion-clothing-blog.com
http://www.apparel-clothing.com
http://www.basketball-stars-blog.com
http://www.ncaa-basketball-forum.com
http://www.basketball-ncaa.com
http://www.basketball-competition-forum.com
http://www.write-blogs.com
http://www.air-ordans.com
http://www.nba-information.com
http://www.nba-website.com
http://www.moncler-women.com
http://www.moncler-men.com
http://www.monclerdown.com
http://www.beauty-bloger.com
http://www.air-ordan-jumpman.com
http://www.beauty-tips-for-girls.com
http://www.newaj.com air jordan
http://www.gucci-shoes.cc gucci shoes
http://www.saleairmaxshoes.com air max