FBML

The Facebook Markup Language can be compared to the “icing” on the cake that is the Facebook API. Although FBML is not completely necessary for writing a successful Facebook application, it brings to the table many features that make development on Facebook more efficient, and in the end, it makes life as a social applications developer much better. For instance, you may have previously retrieved the name of the user of your application through a simple users.getLoggedInUser API call on the server. But perhaps you’ve discovered that it’s not worth going through the entire process of authenticating the user on the server side and returning the application user’s name. Or, what if you want to further separate your presentation logic from your application logic? A name, after all, is not necessarily something that should be calculated or processed. You may want to have your HTML in a file that’s entirely separate from the files you are making API calls from, and therefore something as simple as a name might make sense to include with your HTML.

For these reasons, FBML can be an ideal tool for organizing your Facebook applications and, most of all, for reducing the amount of API requests you have to make to Facebook. One FBML tag on a page takes no HTTP requests off your servers in order to render, whereas a simple API call for the same information could take one HTTP request to authenticate with Facebook and another to retrieve the information desired. This additional overhead slows down your application, and in an environment where you could easily have millions of users using your app, you want to save every request you can.

FBML is a tool, a resource, for you as a developer to make your work in the Facebook API more efficient. FBML brings a lot of power to developers, allowing them to use API calls only when most needed. As I will show in the “Hello World” example in Chapter 1, an entire simple application can be created using FBML alone!

The intent of this book is to get you to the point where you, as a Facebook developer, can decide when FBML makes sense for your application and when you are better off using the Facebook API. It’s my hope that you can continue to use this book as a resource as your development skills mature.

Tip

One topic not covered in this book is the Social Network Markup Language (SNML) and the social networking website Bebo (http://www.bebo.com). SNML is a tag language extremely similar to FBML that works on the recently launched Bebo Developers Platform. However, Bebo also supports certain FBML tags, so this book should serve as a reference for developing on Bebo as well as on Facebook. I will update this book’s Facebook Page (http://page.fbmlessentials.com) with more information regarding Beboʼs SNML and supported FBML tags as this new platform progresses.

Keep in mind that the only FBML tags that Bebo does not yet support are <fb:mobile/>, <fb:visible-to-connection/>, <fb:attachment-preview/>, and <fb:is-in-network/>. Therefore, use this book as you see fit for your Bebo application development! You can read a great how-to article on porting apps from Facebook to Bebo (written by Blake Commagere, developer of the Zombies, Vampires, and Werewolves games on Facebook) here: http://dev.aol.com/article/2008/porting-your-facebook-app-to-bebo.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.35.193