In this article by Siddhesh Kabe, the author of the book Salesforce Platform App Builder Certification Handbook, will introduce you to the Force.com platform. We will understand the life cycle of an application build using Force.com. We will define the multi-tenant architecture and understand how it will impact the data of the organization stored on the cloud. And finally, we will build our first application on Force.com.
We will cover the following topics in this article:
So, let’s get started and step into the cloud.
(For more resources related to this topic, see here.)
Force.com is a cloud computing platform used to build enterprise applications. The end user does not have to worry about networks, hardware, software licenses, or any other things. The data saved is completely secure in the cloud.
The following features of Force.com make it a 100 percent cloud-based system:
Just like how tenants in a single building share the resources of electricity and water, in the multi-tenant system, tenants share common resources and databases.
In a multi-tenant system, such as Salesforce.com, different organizations use the same shared database system that is separated by a secure virtual partition. Special programs keep the data separated and make sure that no single organization monopolizes on the resources.
The subscription model can be visualized like the electricity distribution system. We pay for whatever electricity we use and not the complete generator and the infrastructure.
All the instances hosted on the servers are upgraded with no additional cost. The Salesforce maintenance outage during a major release is only 5 minutes.
The sandboxes are upgraded early so there can be testing for compatibility with the new release. The new releases are backward compatible with previous releases, thus the old code will work with new versions. The upgrades are taken care of by Force.com and the end user gets the latest version running application.
In the earlier edition of the book, we discussed the Force.com platform in detail. In the last couple of years, Salesforce has introduced the new Salesforce1 platform. It encompasses all the existing features of the Force.com platform but also includes the new powerful tools for mobile development. The new Salesforce1 platform is build mobile first and all the existing features of cloud development are automatically available for mobiles. From Winter 16, Salesforce has also introduced the lighting experience. The lighting experience is another extension to the existing platform. It provides a brand new set of design and development library that lets developers build applications that work on mobiles as well as web.
Let’s take a detailed look at the services that form the platform offered by Force.com. The following section provides us with an overview of the Force.com platform.
Force.com is the world’s first cloud application development platform where end users can build, share, and run an application directly on the cloud. While most cloud computing systems provide the ability to deploy the code from the local machine, Force.com gives us the feature to directly write the code in cloud.
The Force.com platform runs in a hosted multi-tenant environment, which gives the end users freedom to build their custom application without hardware purchases, database maintenance, and maintaining a software license. Salesforce.com provides the following main products:
The following screenshot shows the Force.com platform:
The application built on Force.com is automatically hosted on the cloud platform. It can be used separately (without the standard Sales, Service, and Marketing cloud) or can be used in parallel with the existing Salesforce application.
The users can access the application using a browser from any mobile, computer, tablet, and any of the operating system such as Windows, UNIX, Mac, and so on, giving them complete freedom of location.
For a complete list of supported browsers, visit
https://help.salesforce.com/apex/HTViewHelpDoc?id=getstart_browser_overview.htm.
The most efficient way to build an enterprise application is to clearly separate out the model, that is, data, the code, that is, controller, and the UI, that is, the View. By separating the three, we can make sure that each area is handled by an expert. The business logic is separated from the backend database and the frontend user interface.
It is also easy to upgrade a part of the system without disturbing the entire structure. The following diagram illustrates the model-view-controller of Force.com:
We will be looking in detail at each layer in the MVC architecture in the subsequent article.
Force.com is a hosted multi-tenant service used to build a custom cloud computing application. It is a 100 percent cloud platform where we pay no extra cost for the hardware and network. Any application built on Force.com is directly hosted on the cloud and can be accessed using a simple browser from a computer or a mobile.
The Force.com platform runs on some basic key technologies.
The base of the platform forms a multi-tenant kernel where all users share a common code base and physical infrastructure. The multiple tenants, who are hosted on a shared server, share the resources under governor limits to prevent a single instance monopolizing the resources. The custom code and data are separated by software virtualization and users cannot access each other’s code.
The multi-tenant kernel ensures that all the instances are updated to the latest version of the software simultaneously. The updates are applied automatically without any patches or software download.
The multi-tenant architecture is already live for one million users. This helps developers easily scale the applications from one to a million users with little or no modification at all. The following image illustrates the multi-tenant architecture:
Traditional software systems are hosted on a single-tenant system, usually a client-server-based enterprise application. With the multi-tenant architecture, the end user does not have to worry about the hardware layer or software upgrade and patches. The software system deployed over the Internet can be accessed using a browser from any location possible, even wide ranges of mobile devices.
The multi-tenant architecture also allows the applications to be low cost, quick to deploy, and open to innovation. Other examples of software using the multi-tenant architecture are webmail systems, such as www.Gmail.com, www.Yahoo.com, and online storage systems, such as www.Dropbox.com, or note-taking applications, such as Evernote, Springpad, and so on.
Force.com is entirely metadata-driven. The metadata is defined in XML and can be extracted and imported. We will look into metadata in detail later in this article.
The data and the metadata stored on the Force.com server can be accessed programmatically through the Webservice API. This enables the developers to extend the functionality to virtually any language, operating system, and platform possible.
The web services are based on open web standards, such as SOAP XML and JSON REST, and are directly compatible with other technologies, such as .Net, JAVA, SAP, and Oracle. We can easily integrate the Force.com application with the current business application without rewriting the entire code.
Apex is the world’s first on-demand language introduced by Salesforce. It is an object-oriented language very similar to C# or JAVA. Apex is specially designed to process bulk data for business applications. Apex is used to write the controller in the MVC architecture.
Salesforce Object Query Language (SOQL) gives developers an easy and declarative query language that can fetch and process a large amount of data in an easy, human-readable query language. For those who have used other relational database systems, such as Oracle, SQL Server, and so on, it is similar to SQL but does not support advance capabilities, such as joins.
Apex and SOQL together give the developers powerful tools to manage the data and processes of their application, leaving the rest of the overhead on the Force.com platform.
The following screenshot shows the page editor for Visualforce. It is easy to use and splits a page into two parts: the one at the bottom is for development and the above half shows the output:
Visualforce is an easy to use, yet a powerful framework used to create rich user interfaces, thus extending the standard tabs and forms to any kind of interfaces imaginable. Visualforce ultimately renders into HTML, and hence, we can use any HTML code alongside the Visualforce markup to create a powerful and rich UI to manage business applications.
Apart from the UI, Visualforce provides a very easy and direct access to the server-side data and metadata from Apex. The powerful combination of a rich UI with access to the Salesforce metadata makes Visualforce the ultimate solution to build powerful business applications on Salesforce.
As the Salesforce.com Certified Force.com Developer Certification does not include Apex and Visualforce, we won’t be going into detail about Apex and Visualforce in this book.
The developer console is an Integrated Development Environment (IDE) for tools to help write code, run tests, and debug the system. The developer console provides an editor for writing code. It also provides a UI to monitor and debug Unit test classes, as shown in the following screenshot:
AppExchange is the directory of applications build on the Force.com platform. Developers can choose to submit their developed applications on AppExchange. The applications extend the functionality of Force.com beyond CRM with many ready-made business applications available to download and use.
AppExchange is available at http://appexchange.salesforce.com.
Using Force.com sites or site.com, we can build public facing websites that use the existing Salesforce data and browser technologies, such as HTML, JavaScript, CSS, Angular JS, Bootstrap, and so on. The sites can have an external login for sensitive data or a no login public portal that can be linked to the corporate website as well.
Site.com helps in creating websites using drag-and-drop controls. The user with less or no HTML knowledge can build websites using the site.com editor.
Like any other traditional software development process, the Force.com platform offers tools used to define data, business process, logic, and rich UI for the business application. Many of these tools are built-in, point-and-click tools simplified for users without any development skills. Any user with no programming knowledge can build applications suitable to their business on Force.com.
The point-and-click tools are easy to use, but they have limitations and control. To extend the platform beyond these limitations, we use Apex and Visualforce.
Let’s now compare the tools used for traditional software development and Force.com:
| JAVA | Dot Net | Force.com |
Building the database | Oracle, MS-Access, SQL, or any third-party database setup | Oracle, MS-Access, SQL, or any third-party database setup | Salesforce metadata (now database.com) |
Connection to the database | JDBC
| Ado.net | Salesforce metadata API |
Developing the IDE | NetBeans, Eclipse, and so on | Visual Studio | Online Page Editor and App Setup, Force.com IDE, Mavens Mate, and Aside.io |
Controlled environment for development and testing | Local servers, remote test servers | Local servers, remote test servers | Force.com real time sandboxes |
Everything on Force.com such as data models, objects, forms, tabs, and workflows are defined by metadata. The definitions or metadata are made in XML and can be extracted and imported. The metadata-driven development also helps users with no prior development experience to build business applications without any need to code. We can define the objects, tabs, and forms in the UI using point-and-click.
All the changes made to the metadata in App-Setup are tracked. Alternatively, the developers can customize every part of Salesforce using XML flies that control the organization’s metadata. The files are downloaded using the Eclipse IDE or Force.com IDE.
To customize metadata on Salesforce UI, go to Setup | Build:
As Force.com Developer Certification is about using point-and-click, we will be going into the setup details in the coming article.
The metadata API provides easy access to the organization data, business logic, and the user interface. We can modify the metadata in a controlled test organization called the sandbox. Finally, the tested changes can be deployed to a live production environment edition. The production environment is the live environment that is used by the users and contains live data. The production instance does not allow developers to code in them directly; this ensures that only debugged and tested code reaches the live organization.
Force.com provides a built-in online editor that helps edit the Visualforce pages in real time. The online editor can be enabled by checking the Development Mode checkbox on the user profile, as shown in the following screenshot:
The online page editor splits the screen into two parts with live code in the bottom half and the final page output in the top half. Force.com also provides an inline editor for editing the Apex code in the browser itself.
Force.com IDE is an IDE built over eclipse. It provides an easy environment to write code and also offline saving. It also comes with a schema browser and a query generator, which helps in generating simple queries (select statements) by selecting fields and objects. The code is auto synced with the organization.
Force.com provides a real-time environment to develop, test, and train people in the organization. It is a safe and isolated environment where any changes made will not affect the production data or application. These sandboxes are used to experiment on new features without disturbing the live production organization. Separation of test and dev instances also ensures that only the tested and verified code reaches the production organization.
There are three types of sandboxes:
There are some common types of applications that are required to automate an enterprise process. They are as follows:
There are two ways of development on Force.com: one way is to use point-and-click without a single line of coding, called the declarative development. The other way is to develop an application using code, called programmatic development. Let’s take a look at the two types of development in detail.
The declarative type of development is done by point-and-click using a browser. We use ready-to-use components and modify their configuration to build applications. We can add new objects, define their standard views, and create input forms with simple point-and-link with no coding knowledge. The declarative framework allows rapid development and deployment of applications.
The declarative development also follows the MVC architecture in development. The MVC components in the declarative development using Force.com are mentioned in the following table:
Model | View | Controller |
Objects Fields Relationships
| Applications Tabs Page layouts Record types | Workflow rules Validation rules Assignment rules
|
In this article, we became familiar with the Force.com platform. We have seen the life cycle of an application build using Force.com. We saw the multi-tenant architecture and how it is different from the web hosting server.
We have a fresh new developer account, and now in further article, we will be using it to build an application on Force.com.
Further resources on this subject:
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…