Force.com Best Practices - APEX
Force.com
Best Practices:
Apex
ยท
Since Apex is case insensitive you can write it however you'd
like. However, to increase readability, follow Java capitalization standards
and use two spaces instead of tabs for indentation.
ยท
Use Asynchronous Apex (@future annotation) for logic that does
not need to be executed synchronous.
ยท Asynchronous Apex should be "bulkified".
ยท
Apex code must provide proper exception handling.
ยท
Prevent SOQL and SOSL injection attacks by using static queries,
binding variables or the escapeSingleQuotes method.
ยท
When querying large data sets, use a SOQL
"for" loop
ยท
Use SOSL over SOQL where possible - it's much faster.
ยท
Use Apex Limits Methods to avoid hitting governor exceptions.
ยท
No SOQL or SOSL queries inside loops
ยท
No DML statements inside loops
ยท
No Async (@future) methods inside loops
ยท
Do not use hardcoded IDs
Force.com Best Practices - APEX
Reviewed by dasfrogpractice
on
06:06
Rating:

No comments: