Understanding the Force.com model

Force.com offers a platform for development of business applications on the cloud. The platform is offered as a service, where we pay for only those things that are used and not for the entire server and hardware stack. The platform offers many built-in and point-and-click tools for rapid development of applications.

Let's take a detailed look at the services forming the platform offered by Force.com. The following section provides us with an overview of the Force.com platform.

Force.com platform

Force.com is the world's first platform, where end-users can build, share and run an application on the 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 three default applications built and hosted on Force.com. They include:

  1. Salesforce Automation, Sales Cloud
  2. Service and Support Center, Service Cloud
  3. Collaboration Center, Chatter

The following figure shows the Force.com platform:

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, or Mac and so on, giving them complete freedom of location.

The hosted environment also ensures that the software is automatically updated to the latest releases, whether it is Salesforce CRM or a custom application build on Force.com platform. The automatic update automatically upgrades any code or components used by the custom application. As the applications hosted on the Force.com platform have access to a large pool of shared cloud resources, they can be easily scaled to millions of users without significant developer changes.

Model-View-Controller architecture

The key to building any successful business application is a powerful yet loosely coupled Model-View-Controller (MVC) architecture. The MVC architecture ensures that we separate the complex business logic from the UI and the database. This loosely coupled system also helps working in a team. It is also easy to upgrade part of the system without disturbing the entire structure. The following figure illustrates the model-view-controller of Force.com:

Model-View-Controller architecture

The complex business process logic is written inside the controller. The real-life business problems are programmed into powerful data manipulation algorithms. The business logic is separated from the back-end database and the front-end user interface.

Force.com uses workflows, Apex triggers, and Apex controllers as the controller in the MVC architecture.

The view forms the user interface of the system. This gives the designers the best chance of optimizing the complex data coming from the controller in a human readable form.

Force.com uses Visualforce pages, sites, and standard UI (including buttons, forms, tabs, and page views) to define a view.

The backbone of this loosely coupled system forms the model or the database. This powerful database system is offered as the bridges between view and controller. Data is wrapped in the model and send to the UI for display.

The metadata, Salesforce objects, Apex objects, and Database.com schema form the model layer of Force.com

We will be looking in detail at each layer in the MVC architecture in the subsequent chapters.

Key technology behind the Force.com platform

Force.com is a hosted multi-tenant service used to build 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 consists of some basic key technologies.

Multi-tenant kernel

The base of the platform forms a multi-tenant kernel, where all users share a common codebase 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 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. The following image illustrates the multi-tenant architecture:

Multi-tenant kernel

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 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 metadata

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 chapter.

Force.com Webservice API

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 and Visualforce

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 for processing large amounts of 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. SOQL is very similar to SQL used in other database systems and mostly uses similar syntax.

Apex and SOQL together give the developers powerful tools for managing the data and processes of their application, leaving the rest of the overage 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:

Apex and Visualforce

Visualforce is an easy to use, yet powerful framework for creating 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 mark-up to create a powerful and rich UI to manage business applications.

Apart from UI, Visualforce provides a very easy and direct access to the server side data and metadata from Apex. The powerful combination of rich UI with access to Salesforce metadata makes Visualforce the ultimate solution for building 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.

AppExchange

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

AppExchange is available at http://appexchange.salesforce.com.

Force.com sites

Force.com is an easier and efficient way to create a public site using the Salesforce.com data, Visualforce, and HTML/CSS. Using Force.com sites we can build sites with functionality in a jiffy. These sites do not requires a login unless it is designed in such a way.

Siteforce is a new product from Force.com that helps in creating websites using drag-and-drop controls. The sites built using Siteforce do not need any HTML knowledge. The user can directly use readymade components from the directory and create feature-rich websites directly linking their data.

Force.com development

The core process of development involved in traditional software is the same with Force.com. The Force.com platform offers many 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 native users without any development skills. Any user can build applications suitable to their business without a single line of code.

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 us now compare the tools used for traditional software development and Force.com:

 

JAVA

.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 (and now database.com)

Connection to the database

JDBC

Ado.net

Salesforce metadata API

Developing IDE

NetBeans, Eclipse,and so on

Visual Studio

Online Page Editor and App Setup, Force.com IDE

Controlled environment for development and testing

Local servers, remote test servers

Local servers, remote test servers

Force.com real time sandboxes

Force.com metadata

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 eclipse IDE or Force.com IDE.

To customize metadata on Salesforce UI, go to Setup | App Setup:

Force.com metadata

As Force.com Developer Certification is about using point-and-click, we will be going into the setup details in the coming chapters.

Metadata API

The metadata API provides easy access to 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 an enterprise edition or ultimate edition. This ease of access to the organization using metadata API ensures that only debugged and tested code reaches the live organization.

Online page editor and eclipse Force.com IDE

Force.com provides a built-in online editor that helps editing 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:

Online page editor and eclipse Force.com IDE

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.

Online page editor and eclipse Force.com IDE

Force.com IDE is an IDE built over eclipse. It provides an easy environment to write code and also offline saving too. It also comes with a schema browser and a query generator, which is helpful in generating simple queries (select statements) by selecting fields and object. The code is auto synced with the oranization.

Sandbox

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.

Sandbox

There are three types of sandboxes:

  1. Configuration-only sandbox: This sandbox creates a copy of the metadata of the production organization. It also copies the reports, dashboards, price-books, and products. The configuration-only sandbox can be used to configure the production organization, create multiple objects and relationships, and deploy them to the production. This type of sandbox does not copy the production organization data apart from the objects mentioned above.
  2. Developer sandbox: This environment is specially used for coding and testing of the environment by a single developer. Just like the configuration only sandbox, this also copies the entire customization of the production organization excluding the data. The added feature of a developer sandbox is that it allows Apex and Visualforce coding also.
  3. Full copy sandbox: Full copy sandbox copies the entire production organization and all its data records, documents, and attachments. This is usually used to develop and test a new application until it is ready to be shared with the users. Full copy sandbox has the same IDs of the records as that of production only when it has been freshly created.
..................Content has been hidden....................

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