
fact sheet
vendor resources |
Force.com is a cloud platform for building generic business applications. I've long known about salesforce.com and their CRM offering to the marketplace; primarily because I was a user when one of my former employers utilized it to manage their client relationships. Because I develop websites and other types of software, I have been on the salesforce.com developer-focused mailing list for a few years, which is where their other offering, Force.com, comes in. I have stayed abreast of what's possible using their platform for my development purposes, but I only recently waded into the waters of Force.com to see what I would discover and what it would mean to my own PHP development efforts.
Force.com Simplifies Cloud Computing
Cloud computing is reaching critical mass in terms of viability as both an enterprise offering as well as a development platform for ISVs. In short, cloud computing provides a means for running, provisioning, installing, scaling and packaging your applications on the Internet (or Cloud), without concerns about hardware or software configuration and so on. As a result, these applications also typically store, process and retrieve data in the cloud too, instead of accessing the data locally via the desktop or an internal network (I realize I use the term "locally" liberally here).
Force.com provides much more than data storage and retrieval by also allowing you to build custom data objects, business rules, user directories, and testing scenarios. If you think of this list as database tables, data validation and process workflows, security, user authentication and unit testing, respectively, then you should begin to understand the depth of features provided to you via the Force.com platform.
The impact of these features is that less code is required to build your applications. You only need to configure many of these items according to your requirements and you have an application.
Does this mean you can build an application using Force.com and not write any code? Yes—but there's still plenty of opportunities to code where it matters—in your business logic.
Is Force.com some overly abstracted and obfuscated tool that isn't meant for serious coders? No! Allow me to explain.
Force.com Allows Me to Use My Existing PHP Skills to Build Professional Applications
Force.com is a tool for professional developers as well as those just starting out. While you can build applications quite easily and quickly, building professional apps is always made better when you understand the technologies behind a website and how to use them. You need to know how to query data, restrict user access to data, test logic, build data schemas, etc., etc. This is where your PHP development knowledge comes in handy. But with Force.com, you won't need to write any PHP code to build a basic application. The tools provided to you in the platform allow you to use the browser to build the application without code. The details of the application are stored in XML metadata that Force.com stores in its database. If you desire finer control, or want to write custom classes, you can take the platform further with Force.com's Apex programming language. Apex is strongly typed to the objects in your application and gives you a Java-like language for responding to changes in your data or actioning business logic.
As I see it, Force.com provides the plumbing you need for any application, while also giving you tools necessary for building a sophisticated application. As that old adage goes, it makes the simple things easy, and the complex things possible. The tools support simple and complex requirements.
Taking Force.com for a Spin: My Real-Time Review
I created a free developer edition account (think of it as an instantly provisioned application development and runtime environment in the cloud) and went through the Getting Started resources just to see what I could do within a few hours. What I discovered was that I could accomplish a lot with just a little bit of knowledge about Force.com… thanks in large part to the fact that I can already write web applications with PHP and MySQL:
- I know I need objects (tables) that represent real items (i.e. customers, accounts, expenses, etc.)
- I know I need these objects to relate to each other somehow
- I know I need to present the data to users
- I know I need to add logic to validate and respond to the data
So with this knowledge, I built my first Force.com application… a mileage tracking application that interacts with contacts in my developer account.
Custom Objects/Database Objects
The default installation of a Force.com account provides an extensive set of base-level features. It also provides some already prepared database objects used for connecting to their CRM applications (which also run on Force.com), which are supplied out of the box because some of their customers build apps that talk to the CRM apps. You don't have to use these objects though, and can build your own pure application—just ignore them.
I found it very easy to build a Force.com application using my browser. Within the Setup section, I was able to create a Mileage object in just a couple of minutes. Although building the schema required a fair amount of clicking, it was super simple to add the data fields to the object, define their types and relate the object to a Contact object.
 | |
| Figure 1. Creating custom objects in the Force.com web interface. |
Relating Data to Each Other
Relating objects to one another is done by adding a Lookup Relationship (or a master-detail relationship) field to your object and then choosing the object it should reference, or "lookup". Force.com adds the relationship to the application's metadata and manages it for you. Once you define a relationship, you can further define it by adding filters to the lookup and creating error message for invalid selections (see Figure 2). What's interesting is that this is a level of abstraction above SQL joins and foreign keys. You just define a field in one object that relates to another—the platform does the rest.
 | |
| Figure 2. Creating Lookup Filters to further customize a relationship. |
Adding Data Validation Rules
You can ensure your users input only valid data for in each field by creating validation rules. I wasn't surprised to learn that creating rules is easy. I was able to edit the Mileage object and add a new rule quickly (see Figure 3). Obviously, I expected to have the ability to write formulas to validate the data, but I was pleasantly surprised by the formula editor and how well it worked. I was able to quickly choose the field to validate and write a formula using the tools. If you choose a supported Function and insert it into the formula field, Force.com includes the formula syntax to add a nice touch of guidance.
 | |
| Figure 3. Creating a validation rule. |
These rules are specific to each object. I wish there were a way to reuse the same rule across all objects, but at the moment, it appears you have to build the rule into each object separately.
Displaying Data
Displaying data occurs within Tabs by default. You might think of each tab within a Force.com application as a different page within the web application. As you build objects you will need to build tabs to serve as the object "hosts" and to display the data and forms related to the object. I was able to define tab through the setup tools by choosing my custom object and defining a tab style (i.e. the tab icon). Once I created the tab, it was visible within my Force.com application (see Figure 4).
 | |
| Figure 4. The mileage tab with data. |
What's interesting is that Force.com creates the entire CRUD spectrum of screens for you automatically. So Figure 4 shows the listing page, but you can also create, read, and update records. It's all in the metadata it seems. When you define your object, you determine what data you're going to store, and the types of the data (and those validation rules I showed you in the previous section, and so on). Force.com treats this all as metadata—and at run time it dynamically processes this metadata to build the CRUD screens. This is pretty powerful because it means that if I change the metadata (add a field to an object, for example) then it is instantly reflected in the user interface.
I don't have to use this user interface mechanism—I can also go and create my own pages using their Visualforce technology, which is an XML-based component markup language, with templates and so on.
My Takeaways
Overall, I'm impressed by the Force.com platform and I see opportunities for me as a developer and consultant. The fact that I can build an application by defining objects, relationships, views, etc., versus coding everything is compelling. It's a big time and effort saver, which means I can potentially do more for my clients while also saving them money—maybe charging the same amount but providing more value. I also don't have to worry about hosting the apps, upgrading the servers, security frameworks, user authentication frameworks, web servers, software installs, operating systems and so on.
Also, Force.com has an app store called AppExchange that enables you to publish your application to the Exchange where it can be downloaded to a Salesforce.com subscriber's account with a single click. The potential customer base that is available to me at AppExchange also got my attention and is something I will investigate further in the near future.
To top it all off, Force.com provides a couple of web service APIs, that let you control logic, access your data and so on. I like the idea that I could build my application on Force.com and use it as the data layer and business logic layer for my PHP applications—they even have a PHP wrapper around these APIs to simplify the task. Force.com makes it easy too, by allowing you to generate a WSDL file from your account at anytime. The WSDL file includes definitions for the custom objects you create, so as you customize Force.com and extend it via PHP sites, you can essentially update the API associated with your account by generating a new WSDL file.
So my take is that Force.com is worth investigating. The platform does a good job of making it easy for developers to get started—as evidenced by the fact I had an application built in just over an hour. But don't let the simplicity or "easy"-ness of it turn you off, because the platform also provides a means to move into more complex, or finer-tuned, development scenarios that involve writing your own code using the Force.com language (Apex) as well as building custom layouts and UIs (using Visualforce). Also, you can download the Force.com PHP Toolkit for free. So, give it a go!
Read More: Getting Started In the Cloud: Java-Based App Development on the Force.com Platform »