This is the second in a series of posts sharing my experiences with building a Java/Spring Facebook application using Skyway Builder Community Edition. In the first post I laid out the general plan, and in this post I will give an overview of Facebook application development.
I won’t spend any time introducing Facebook, which is described on their front-page as “a social utility that connects you with the people around you“. I presume you:
- know what Facebook is
- have used Facebook
- have a Facebook account
- have added at least on Facebook application
In exploring Facebook, you may have discovered that there are many available Facebook applications. Some are provided by Facebook itself, but most are 3rd party applications that are integrated with Facebook. You can find applications in the Application Directory, but the most common ways of finding applications is from your Facebook friends. Last year Facebook launched the Facebook Platform, which provided developers a way to build and publish their own Facebook applications. The Facebook user community can install these applications into their Facebook account.
If you are interested in developing a Facebook application, then you must add the Developer application to your profile. This application is provides developers with a variety of resources, including news, status, and a discussion board. This is also where you can setup a new application.
I won’t cover all the application settings at this point, however I do want to focus in on the Canvas Page URL setting. There’s two parts to this setting. The first part is where you specify the Facebook url for accessing your application. Every Facebook application has a URL that starts with “http://apps.facebook.com/”, and for each application you append a path to the URL to come up with a unique Facebook application URL (i.e. http://apps.facebook.com/myapp/). The second part of this setting is the FBML/IFRAME selection, and your selection will depend on how you want to integrate your application into Facebook. This setting is specifying the markup language of your application and subsequently the Facebook/application interaction model.
I wanted to build my Facebook application as a Spring-based JEE web application (war) and deploy it to a light-weight JEE stack consisting of Tomcat and MySQL. While the Facebook Markup Language (FBML) alternative offers some conveniences, I wanted to produce a web application that uses standard HTML. So I selected the “IFRAME” option. The resulting interaction model is also a benefit. As opposed to the FBML option which requires that Facebook proxy all calls to my application, the IFRAME option carves at a portion of the Facebook UI for my application that is loaded directly from my servers.
Another setting of a Facebook application is the Callback URL. I’ll describe this setting in more detail in subsequent posts, but this URL is essentially the URL that Facebook will use to embed your application in the IFRAME.

This diagram describes the association between the Canvas Page URL, Callback URL, and the resulting interaction model:
#1: The end-user of the application makes a call to the Canvas Page URL for your application. The URL is a Facebook URL that, among other things, points to a Facebook server.
#2: The Facebook server generates and returns the HTML associated with the requested page. The page includes an IFRAME that has a URL pointing to the Callback URL.
#3: The end-user’s browser makes another call to the Callback URL. This URL is pointing to your deployed Facebook web application wherever it may be hosted.
#4: Your Facebook application generates and returns the HTML associated with your application’s functionality. The HTML is embedded into the IFRAME section of Facebook page (from #2).
Stayed tuned for part 3.