4. Business Logic

Business logic in Force.com is developed in Apex, a programming language designed for the Force.com platform. Through Apex code, many platform features, such as the database and user interface, can be customized to meet the needs of individual users and companies.

This chapter introduces Apex as a language for writing business logic, specifically where it interacts with the Force.com database. It uses a combination of explanatory text and code snippets to introduce concepts and encourage experimentation. This approach assumes you’re already experienced in some other high-level, object-oriented programming language and would like to see for yourself how Apex is different.

The chapter consists of the following sections:

Image Introduction to Apex—Learn basic facts about Apex and how it differs from other programming languages.

Image Introducing the Force.com IDE—Take a brief tour of the Force.com IDE, a user interface for developing, debugging, and testing Apex code.

Image Apex language basics—Learn the building blocks of the Apex language, such as data types and loops.

Image Database integration in Apex—Incorporate the Force.com database into your Apex programs through queries, statements that modify data, and code executed automatically when data is changed.

Image Debugging Apex using Developer Console—With Developer Console, you can directly inspect the state of your Apex code as it runs.

Image Unit tests in Apex—Write tests for your code and run them in Developer Console.

Image Sample application—Walk through the implementation of a data validation rule for the Services Manager sample application.


Note

The code listings in this chapter are available in a GitHub Gist at http://goo.gl/evtet.


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

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