Why Amazon’s new AWS java sdk sucks
I am an ardent fan and user of Amazon’s AWS and that is the reason I don’t like their new API. Amazon has so far done a great job of making their services very intuitive, simple and easy to use. But somehow they forgot their principals while designing the sdk. In this post I am planning state my case.
Let’s discuss an example. The example is in groovy, but I am sure the code can be understood by everybody:
def registerInstance(String instanceId, String loadBalancerName) {
def request request = new RegisterInstancesWithLoadBalancerRequest()
def server = new com.amazonaws.services.elasticloadbalancing.model.Instance()
server.setInstanceId(instanceId)
request = request.withInstances([server]).withLoadBalancerName(loadBalancerName)
def client = new AmazonElasticLoadBalancingClient(awsCredentials)
client.registerInstancesWithLoadBalancer(request)
logger.info "${instance.getPublicDnsName()} registered with ${loadBalancerName} load balancer"
}
Above code simply registers a given instance with a load balancer. Now let’s try to achieve the same thing using a different API available on Google code. It’s called Typica and is written by dkavanagh and two other persons.
def registerInstance(Stirng instanceId, String loadBalancerName) {
def loadBalancing = new LoadBalancing(accessKey, secretKey)
loadBalancing.registerInstancesWithLoadBalancer(loadBalancerName, [instaceId])
}
Now which one is easier to read? Which one is faster to code? Which is more intuitive? Obviously the second one. I simply don’t understand the reason for long class names they have throughout the API and the request and result pattern. Every single method in Amazon’s sdk take a request object and return a result object. You are forced to create these extra long name objects! Thank god I did not write the code in java here, otherwise it wouldn’t have been even bigger as in Java you have to repeat a class name twice in a line if you want to create an object. The whole api is full of such examples.
I am not the only one screaming over the API. Steve Jin has expressed similar concerns about the API in his DoubleCloud Blog. According to Steve the API lacks consistency, clear object model and the structure of the API is flawed.
Hope enough people scream over the Internet so that Amazon can hear it.

July 22nd, 2010 at 3:13 am
Buy:Maxaman.Viagra Soft Tabs.Soma.Propecia.Cialis Soft Tabs.Viagra Professional.Cialis.Levitra.Viagra.Tramadol.Viagra Super Force.Super Active ED Pack.Cialis Super Active+.VPXL.Cialis Professional.Zithromax.Viagra Super Active+….
August 29th, 2010 at 10:31 pm
Compactor http://jventlessufn.01DODGEPARTS.US/tag/bags+compactor+Compactor/ : Compactor…
bags…
September 10th, 2010 at 6:12 pm
Buy:Zetia.Cozaar.Buspar.Female Cialis.Aricept.Advair.Lipothin.Benicar.Lipitor.Zocor.Lasix.Female Pink Viagra.Acomplia.SleepWell.Ventolin.Wellbutrin SR.Prozac.Amoxicillin.Seroquel.Nymphomax….
September 14th, 2010 at 7:54 pm
Hays http://sye.j0h.i33.co : Hays…
Hays…