0% found this document useful (0 votes)
30 views4 pages

Introduction To Apex

Apex is an object-oriented, on-demand programming language built on the force.com platform, designed for cloud-based applications with minimal setup requirements. It features a Java-like syntax and is integrated with Salesforce data structures, allowing for efficient development and deployment of business logic. Apex is governed by specific limitations and does not support certain functionalities like graphic libraries or multi-threading.

Uploaded by

helloharry.dagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Introduction To Apex

Apex is an object-oriented, on-demand programming language built on the force.com platform, designed for cloud-based applications with minimal setup requirements. It features a Java-like syntax and is integrated with Salesforce data structures, allowing for efficient development and deployment of business logic. Apex is governed by specific limitations and does not support certain functionalities like graphic libraries or multi-threading.

Uploaded by

helloharry.dagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1

Introduction to Apex

 Apex is an object oriented on-demand programming language


 Programming Language:
 A program is a set of instructions given to a computer to perform a specific operation
 A computer is a computational device which is used to process the data under the control
of a computer program
 Program is a sequence of instruction along with data. While executing the program, raw
data is processed into a desired output format
 These computer programs are written in a programming language which are high level
languages
 High level languages are nearly human languages which are more complex than the
computer understandable language which are called machine language, or low-level
language
 Compiler is a software which converts a program written in high level language (Source
Language) to low level language (Object/Target/Machine Language)
 Object-Oriented:
 Objects are discrete bundle of codes (data and related operations) modeled after things
in the real words
 Classes are the blueprint of an objects
 Objects are the instance of a class
 On-demand:
 On demand languages are entirely provided by a service provider, and so usually have
minimal requirements to get started
 For example, with client-side applications, you need a compiler or interpreter that has to
run on each client, and have to find a way to install/distribute these components to other
systems
 On demand languages compile and run "in the cloud," are easily distributed, and usually
requires no more software than what comes standard with most operating systems (e.g.
a web browser)
 'On Demand' means, you can use the tool at any places, irrespective of any machine.
Whenever you want, it will be available. Functionality that you need available in the
cloud, when you need it
 Automatically plugged into other force.com platform features
 It is Java like and build on the force.com platform
 It is multi-tenant, scalable, secure and running on salesforce.com servers
 The code you write plugs write into other platform features
 It runs in the cloud so you don’t have to worry about software and hardware
 Your data structure already exists, so you can reference the same sObjects and fields created
through the declarative Setup menu
 Apex is a data focused and it is strongly integrated with data
 Apex is upgraded as a part of salesforce release
2

 Apex is backward compatible (We can save our apex code against different versions of
Force.com API)
 It has a build in framework for testing and deployment

How Does Apex Work?

Developer action:

 When developer writes and save apex code to the platform, the platform app server first
compiles the code that can be understood by apex runtime interpreter and then saves those
instruction as compiled apex

End User Action:

 When the end user performs some actions, which involves the apex code (clicking a button,
accessing a VF Page) the platform app server retrieves the compiled instructions from meta-
data and send them through runtime interpreter before returning the result.
 The end user observes no differences in the execution time as compare to the standard app’s
platform request

Traditional Code Vs Apex Code:

 Traditional code is fully flexible and tell the system to do anything


 Apex is governed and can only do what the system allows

Apex vs Java:

Commonalities:

 Both have classes, inheritance, polymorphism and other common OOP features
 Both have extremely same syntax and notation
 Both are compiled and interpreted
3

 Both are transactional

Differences:

 Apex runs in its multitenant environment and is very controlled by its invocations and
governor limits
 Apex is case-insensitive
 Apex is on-demand and is compiled and executed on the cloud
 Apex is not a general-purpose programming language but it’s the proprietary language
used for specific business logic functions
 Apex requires unit testing for deployment into the production environment

Features not supported by Apex:

 No Graphic Library: It can’t show the elements in UI other than error message
 It can’t change all the standard SFDC functionalities but can be used to customize and add new
functionalities
 It can’t be used to create temporary files
 It can’t create multiple threads

Apex code can be invoked in the following ways:

Declarative Tool (Clicks) vs Programmatic Tools (Code):


4

Before you commit to developing a new feature using programmatic tools such as Visualforce, consider
whether you can implement your feature with declarative tools instead:

Salesforce features built with declarative tools:

 Are usually faster and cheaper to build


 Generally, require less maintenance
 Receive automatic upgrades when the tools are improved
 Aren’t subject to governor limits

Programmatic tools are often required for features that:

 Support specialized or complex business processes


 Provide highly customized user interfaces or customized click-through paths
 Connect to or integrate with third-party systems

Declarative Programmatic
Page Layouts, VF Pages,
User Interface
Record Types Lightening Components
Formula Fields,
Apex Controllers,
Business Logic Validation Rules,
Apex Triggers
Workflows and Approvals
Objects, Metadata API, Rest API, SOAP
Data Model
Fields and Relationships API, Bulk API

You might also like