A Rose By Any Other Name…
One of the great things about developing for salesforce.com is that there are any number of options when it comes to language support- toolkits are available for pretty much every flavor of programming language a modern application might utilize, so you’re free to pick and choose as the situation and your skillset may dictate.
Earlier, we looked at some different tools that are useful for developing on the Force.com platform- these were really aimed at supporting and enhancing your ability to use salesforce.com’s native languages, Apex and VisualForce, as well as perform data manipulation tasks. Today, we’ll be taking a look at just a few of the various libraries that exist today that make developing for salesforce.com so versatile.
Ruby on Rails
Ruby is my latest kick, and there are a couple ’staples’ when it comes to integrating with salesforce.com from a Ruby or Rails application.
RForce is what I would consider a ‘low-level’ gem, that creates a direct binding to the salesforce API. It requires a little bit of knowledge to setup and use properly. The project documentation has a simple example of creating and using the RForce binding to connect and use some basic API calls, but I have found it’s mostly trial and error when it comes to actually using it in a project.
ActiveSalesforce is another gem that actually utilizes the RForce low-level binding, but wraps it in an easier-to-use package. It allows you to set a salesforce.com org as a datasource in your database.yml config and interact with it just as you would any other database- create a model class to represent your Account object, for instance, and you can use all the built-in Rails functionality to search through it:
accts = Account.find(:all)
Both of these gems are pretty easy to use, once you’ve seen a few code samples. Examples may be a bit hard to come by, but I plan on posting some samples here from time to time.
One of my current pet projects is a gem wrapper around the Metadata API for salesforce.com- it’s in an early stage, but the possibilities are exciting.
JavaScript/AJAX
Salesforce has written a JavaScript wrapper around their Web Services API, known as the AJAX Toolkit. It’s hosted and available on every salesforce.com server that has API access enabled- you can simply add the code below to an S-Control to include the library on your page.
<script src="/soap/ajax/15.0/connection.js" type="text/javascript"></script>
S-controls, and the AJAX toolkit, are beginning to go the way of the dinosaur with the advent of VisualForce and Apex, however, they are still a viable solution for many situations facing developers today.
Next in this series: A rose by any other name… Part 2