Wednesday, November 24, 2010

vCloud SDK

VMware released SDK for vCloud API for Java, PHP and C# to bring the API in developer's own world. The success of API relies on not just how technically superior it is but how easy it is to adapt in real life in developer's choice of language. The SDK is an attempt to exactly do the same.
We will use Java SDK in most of our examples primarily because it was first one to get released but more importantly its widely used in the ecosystem.
As we saw that one of the important tenet of API is the data model. The users expect the solid object model that is in line with their use cases and their choice of language and the Java SDK exactly brings it to them. The vCloud API defines this model using XML schemas which are commonly available as part of the specification. Java SDK brings these REST resources to developers as Java object using JAXB. This completely hides the clients from the XML that defines the request/response payload for the vCloud API. Simply put NO XML processing code in clients.
It also handles the HTTP communication so that the client is dealing with only application level Java objects. Developer's life is further eased by providing utility or wrapper classes that hides some of the complexities and help avoid boiler plate code.

API Commandments
•    Less is more.
•    vCloud API Resource model types should be accessible to the clients as is; do not hide them
•    Use composition to handle the use cases and not inheritance. 
•    Hide the URL semantics
•    Hide HTTP communication details
•    Hide object marshalling/un-marshalling to and from the XML needed for the REST request-response
•    Expose the Object Oriented nature of REST resources
•    Associate the resources with their operations

Here are some of the good starting points for SDK and vCloud API. Do not forget to check the samples bundled with the SDK.

http://communities.vmware.com/community/developer/forums/vcloudapi
http://communities.vmware.com/community/developer/forums/vcloudsdkjava
http://communities.vmware.com/community/developer/forums/vcloudsdk-net

Very helpful presentations  @  VMworld.
http://www.vmworld.com/docs/DOC-5153
http://www.vmworld.com/docs/DOC-5405

We will visit the vCloud API again, but now using the SDK.  I will refrain from repeating the information that’s already available in the SDK samples.:-)

No comments:

Post a Comment