Introduction To Apex
Introduction To Apex
Introduction to Apex
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
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
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
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
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
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
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:
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