The best of TrailblazerDX 2022: Best-practices for Apex
The best of TrailblazerDX 2022: Best-practices for Apex
TrailblazerDX (formerly known as TrailheaDX) is a Salesforce event aimed at Salesforce Developers, Architects, Admins and anyone else dealing with the platform. Naturally, we at CaseNine keep a close eye on developments. In a series of articles, we recount the most important developments that were covered during TrailblazerDX.
During TrailblazerDX, one of the topics discussed was Apex. For those not yet aware of it, Apex as a language allows developers to build the back-end on the Salesforce platform and work efficiently with user data within the platform. If, after reading this article, you want to go in depth with Apex, also take a look at this page. Here you will find a clear explanation of the features and benefits of Apex.
Best practices for Apex
During TrailblazerDX, the focus included valuable best practices with Apex in 2022. CaseNine's Lead Engineer reviewed recommendations and compiled a Top-5 of appealing best practices.
#1 Apex Recipes
Apex Recipes consists of a Github repo containing all kinds of useful utilities that you can apply within your project. The utilities not only improve the user experience for the developer, but also help you speed up the development process. The Apex Recipes are also useful in practice when you still have relatively little experience with the Salesforce ecosystem.
#2 Field Level Security and CRUD Security
For developers, it is important to use FLS (Field Level Security) and CRUD Security. The classes CanTheUser and Safely contain practical examples to help you correctly apply security features in your project or application.
#3 Caching!
In practice, caching plays a big role in the final performance of your project. Even when you are not satisfied with the performance, it is wise to employ the capabilities of caching. With Platform Cache, you can minimize database usage. The result: a potential speed gain for your application.
#4 Queuables
Do you need to process large amounts of data in your Salesforce application? Then take a look at the capabilities of queuables. These allow you to process data on serialization. Moreover, when errors occur in your application, you can resolve them using the Transaction Finalizers concept.
#5 Trigger Framework
It is important to streamline the use of triggers. With a Trigger Framework, you keep more overview and control over the use of triggers within your project. Moreover, a Trigger Framework also makes working with triggers within a project team a lot more pleasant. Use the principle of one trigger per object to maintain an overview.
Want to learn more about the real-world benefits of a CPQ solution? Read more background information here.
Interested in what we can do for you?
Contact our experts directly. We'd love to hear from you!
Curious for more? Subscribe to the Technical Deep Dive series today.
Receive notification when a new blog arrives
We would love to keep you updated on the latest news.