| Course Teaching | You are Offering Professional Course | Locality Choozhampala |
What is Apex?
Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on Salesforce servers in conjunction with calls to the API.
As a language Apex is...
Easy to use
Apex is based on familiar Java idioms, such as variable and expressions syntax, block and conditional statement syntax, object and array notation, and so on. Where apex introduces new elements, it's uses syntax & semantics that are easy to understand and encourage efficient use of the force dot com platform.
Data Focused:
Apex is designed to thread together multiple query and DML statements into a single unit of work on the force dot com platform server much as developers use database stored procedures to thread together multiple transaction statements on a database server.
Automatically upgradeable:
Apex never need to be rewritten when other part of the force dot com platform are upgraded. Because the compiled is stored as metadata in the platform, it always gets auomatically upgraded with the rest of the system.
Easy to Test:
Apex provides build in support for unti test creation and execution, including test results that indicate how much code is covered, and which part of your code could be more efficient. Salesforce dot com ensures that apex code always work as expected by executing all unit tests stored in metadata prior to any platform upgrades.
How does apex works?
Apex is compiled, stored and run entirely on the Force dot com platform.
Benifits of Apex
Is java Like and built on the force dot com platform
It is multi tenant, scalable, secure, proven and trusted running natively on Salesforce server.
The code that you write plugs right into ther platform features.
Runs in the cloud and does not require any hardware or software to be installed.
Enable developers to execute business logic while saving records.
Automatically works with the new salesforce releases.
Has a build-in-frame for testing and deployment.
Apex class defination
In apex you can define top level classes as well as inner classes, that is, a class defined within another class. You can only have inner class one level deep.
To define a class specify the following:
Access modifiers:
- You must use one of the access modifiers in the declaration of a top level class
- You do not have to use an access modifier in the declaration of an inner class
- Optional defination modifiers( such as abstract, virtual and so on)
Required:
-The keyword class followed by the name of the class
-Optional extension and/or implementations.
Use the following syntax for defining classes
The Private access modifier declares that this class is only known locally i.e. only by this section of code. This is the default access for inner classes i.e. if you don't specify an access modifier for an inner class, it is considered private. This keyword can only be used with innner classes.
The public access modifier declares that this class is visible in your application or name space.
With Sharing or withour sharing keyword specify the sharing mode for this class. For more information see Using with Sharing and without sharing keywords.
Thanks for reading.....