The preceding figure shows the overview of the Force.com platform. The following table shows you the difference between the traditional platform and the Force.com platform.
Key features of the Force.com platform
The following are the key features of the Force.com platform:
- Multitenancy
- Application services
- Force.com metadata
- MVC architecture
- Programming language
- Integration
- Force.com sites
- AppExchange
Multitenancy is the major technology of the Force.com cloud platform. It is used to share the IT resources in a secure and cost-effective way. Let's consider a real-world example to understand the multitenancy. Let's think about a luxury apartment complex with some facilities such as a playground, a swimming pool, and a gymnasium. This apartment complex has multiple owners. Everyone owns a separate apartment and every owner uses the shared playground, the shared swimming pool, and the shared gymnasium. These facilities are equal to a single, shared stack of hardware and software. The apartment is equal to the instance of a single client (a tenant). Therefore, a client has their own apartment with shared facilities and privacy.
There are some advantages of multitenancy, which are as follows:
- User satisfaction
- Cost reduction
- Automatic upgrades
- No maintenance
- Enhanced quality
- User retention
- Application providers can reach the hosted application
- Application providers can gather some information (such as errors and performance issues) of the application, which will be helpful to make further enhancements
- An error can be incurred from a particular tenant, but the solutions will be received by all the users who use the application
In traditional software development projects, we have to build or integrate various additional support applications such as login, validations, e-mail functions, reporting, UI, testing, and integrations. You had to repeatedly build these kinds of additional support applications in different projects. The Force.com platform provides the majority of support applications, which are most commonly needed in developing today's business application. For example, the Force.com platform has various features to automate your business process such as reporting, workflow and approvals, e-mail, user authentication, and integrations. These services are common to many software projects. Therefore, we can build applications with more functionality and within a short time period.
With multitenancy, we get secure, fast, reliable, customizable, and upgradable applications. When it comes to custom extensions by multiple tenants, we need to track and keep tenant-specific customizations without affecting the core application. The metadata-driven architecture takes care of that. After multitenancy, metadata-driven architecture is the second most important architecture in the Force.com platform. All the configuration, customization, and coding in the Force.com platform are defined and available as XML. It can be extracted and imported via a set of web services. Simply, metadata is data about data. The metadata-driven model provides the following advantages:
- Complex applications can be created by only using point-click developments (without any coding).
- A developer can build the application with the end user experience but the elements of the application are automatically translated to the metadata at creation time.
- Metadata provides a speedy development.
- Customization and extensions can be done without affecting the end user.
- Metadata can be used to construct an identical environment to use in another organization.
- Metadata can be used to assist version controlling.
- Metadata can be used for testing and troubleshooting by comparing multiple environments.
The preceding figure shows the metadata-driven architecture of Force.com. It creates the separation between the runtime engine, the application data, and metadata. The polymorphic application includes database tables, relationships, UI elements, pages, classes, and so on.
The Force.com platform uses the Model View Controller (MVC) architectural pattern for developing an application:
- Model: This defines the structure of the data. In Force.com, objects define the data model. Salesforce has designed the platform by mapping every entity to some object.
- View: This defines how the data is represented. In Force.com, page layouts and Visualforce pages come under this category.
- Controller: This defines the business logic. The rules and actions which manipulate the data control the view. In Force.com, apex classes, triggers, workflows, approvals, and validation rules are under this category.
The Force.com platform provides its own set of programming language, mark-up language, query language, and search language.
Apex, the world's first on-demand language is considered as the programming language of the Force.com platform. Apex is object oriented and the syntax is similar to Java and C#. It allows developers to build the logic with the interaction of existing platform features. According to the MVC architecture, Apex falls into the controller because it is used to write the controller classes and triggers on the Force.com platform. Apex can be used to:
- Create custom controllers/Controller extensions
- Create triggers that are executed automatically in records such as insert, update, delete and undelete particular objects
- Access and invoke external web services
- Create batch jobs
Visualforce is an implementation of MVC architecture. In the Force.com platform, we can develop Force.com applications with custom objects and standard objects. Every object has a standard user interface with one or more page layouts. But we cannot use standard page layouts for complex requirements. Here, Visualforce comes into play.
Visualforce is a web-based user interface framework, which can be used to build complex, attractive, and dynamic custom UIs. Visualforce allows the developer to use standard web development technologies such as jQuery, JavaScript, CSS, and HTML5. Therefore, we can build rich UIs for any app, including mobile apps. We'll be discussing Visualforce with standard web development technologies and Visualforce for mobile in more depth later. Similar to HTML, the Visualforce framework includes a tag-based markup language.
Salesforce Object Query Language (SOQL) allows us to fetch data from Saleforce objects. SOQL syntax is similar to SQL but simpler. For example, SOQL has the SELECT keyword but doesn't contain the INSERT or UPDATE keywords. It is different from SQL as SOQL doesn't have the JOIN keyword. SOQL can be used in Apex code and it provides a powerful feature to manipulate and process data in Apex code.
Tip
Salesforce objects are similar to database tables. This will be explained in the next couple of chapters.
Salesforce Object Search Language (SOSL) allows us to search your organization's data from Salesforce objects by specifying a text expression, scope of field to search, list of objects and fields to retrieve, and conditions to select rows in the source objects.
Tip
SOQL is used to fetch data from a single object and SOSL is used to fetch data from multiple objects. More about SOSL and SOQL will be discussed in Chapter 7, Custom Coding with Apex.
The Force.com platform provides the facility to integrate with existing applications. There are various advantages of integrating, such as including external systems into our processes, syncing data from multiple sources, and accessing data in other systems. Using an open Simple Object Access Protocol (SOAP) web service, the Force.com API provides access to all the data stored in the application. There are integration benefits as follows:
- By using Force.com technologies, it takes less time to integrate than traditional integrations
- The Force.com platform-based API provides direct and low-level access to Salesforce application data and metadata
- There are many options to choose integration technologies and solutions that fit into their existing system
- Proven platform and integration
Force.com sites allow us to create public sites using Salesforce.com data, Visualforce, and standard web technologies such as CSS, JavaScript, and jQuery. Force.com sites are directly integrated with the Salesforce organization and it doesn't require a user authentication using the Salesforce username and password. A Force.com site has the following features and benefits:
- Data from selected organizations can be exposed to the public through your own domain URL
- There are no integration issues because Force.com sites are hosted on Salesforce servers
- It can be built using Visualforce pages
- According to the requirement, you can enable or disable the user registration
With the preceding features, you can build different kinds of applications. But how can you publish and distribute these applications? AppExchange will do it for you. AppExchange is the place to submit your developed applications, which can be directly installed in the client's organization.