<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>My AWS Musings &#187; SDK</title>
	<atom:link href="http://aws-musings.com/category/sdk/feed/" rel="self" type="application/rss+xml" />
	<link>http://aws-musings.com</link>
	<description>Cloud computing, EC2, RDS, SQS, S3, Java...</description>
	<lastBuildDate>Mon, 30 May 2011 18:13:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Why Amazon&#8217;s new AWS java sdk sucks</title>
		<link>http://aws-musings.com/why-amazons-new-aws-java-sdk-sucks/</link>
		<comments>http://aws-musings.com/why-amazons-new-aws-java-sdk-sucks/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 00:48:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SDK]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=292</guid>
		<description><![CDATA[I am an ardent fan and user of Amazon&#8217;s AWS and that is the reason I don&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>I am an ardent fan and user of Amazon&#8217;s AWS and that is the reason I don&#8217;t like their <a href="http://aws.amazon.com/sdkforjava/">new API</a>. 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.</p>
<p><span id="more-292"></span></p>
<p>Let&#8217;s discuss an example. The example is in groovy, but I am sure the code can be understood by everybody: </p>
<p>             <code><br />
                 def registerInstance(String instanceId, String loadBalancerName) {<br />
                 &nbsp;&nbsp;def request request = new RegisterInstancesWithLoadBalancerRequest()<br />
                 &nbsp;&nbsp;def server = new com.amazonaws.services.elasticloadbalancing.model.Instance()<br />
                 &nbsp;&nbsp;server.setInstanceId(instanceId)<br />
                 &nbsp;&nbsp;request = request.withInstances([server]).withLoadBalancerName(loadBalancerName)<br />
                 &nbsp;&nbsp;def client = new AmazonElasticLoadBalancingClient(awsCredentials)<br />
                 &nbsp;&nbsp;client.registerInstancesWithLoadBalancer(request)<br />
                 &nbsp;&nbsp;logger.info "${instance.getPublicDnsName()} registered with ${loadBalancerName} load balancer"<br />
             }<br />
</code></p>
<p>Above code simply registers a given instance with a load balancer. Now let&#8217;s try to achieve the same thing using a different API available on <a href="http://code.google.com/">Google code</a>. It&#8217;s called <a href="http://code.google.com/p/typica/">Typica</a> and is written by <a href="http://code.google.com/p/typica/people/list">dkavanagh and two other persons</a>.</p>
<p><code><br />
def registerInstance(Stirng instanceId, String loadBalancerName) {<br />
&nbsp;&nbsp;def loadBalancing = new LoadBalancing(accessKey, secretKey)<br />
&nbsp;&nbsp;loadBalancing.registerInstancesWithLoadBalancer(loadBalancerName, [instaceId])<br />
}</code></p>
<p>Now which one is easier to read?  Which one is faster to code? Which is more intuitive? Obviously the second one. I simply don&#8217;t understand the reason for long class names they have throughout the API and the request and result pattern. Every single method in Amazon&#8217;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&#8217;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.</p>
<p>I am not the only one screaming over the API. Steve Jin has expressed similar concerns about the API in his <a href="http://www.doublecloud.org/2010/04/amazon-aws-sdk-for-java-it%E2%80%99s-not-quite-there-yet/">DoubleCloud Blog</a>. According to Steve the API lacks consistency, clear object model and the structure of the API is flawed. </p>
<p>Hope enough people scream over the Internet so that Amazon can hear it.</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/why-amazons-new-aws-java-sdk-sucks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

