I recently revised the original Factory pattern article, and wanted to write a follow-up after a few years' spent reflecting on its usage within Apex. In particular, I'd like to talk a little bit about the Singleton pattern, and how with a small amount of work we can enhance the existing Factory class in order to gracefully create cached instances of classes where a large amount of work goes into constructing them.| www.jamessimone.net
A few months ago I was tasked with replacing Declarative Lookup Rollup Summaries (DLRS) in an org suffering from frequent deadlocks. Rollup summary fields in Salesforce are plagued by severe limitations -- only being available on master-detail relationships being just the start of the list. Read on to learn about how I built Rollup to assist in orgs looking for DLRS-like flexibility with a much smaller performance overhead, complete with elastic scaling (go fast when you need to, slow when th...| www.jamessimone.net
Setting delays programmatically within Apex represents a unique challenge. We don't have access to the current thread instructions that are being carried out, nor do we have any kind of higher-level `delay` function. While this is frequently fine for internal usage, where the last thing you would want is for your compiled code to be slow, that's not always the case when interacting with external APIs. It's common for APIs to be 'rate-limited' - go over the number of requests you're supposed t...| www.jamessimone.net
So-called Lazy evaluated functions have their actual execution delayed until a terminator function is called. It's common for lazy functions to be chained together using fluent interfaces, culminating with actions being performed when the terminator function is called. What can Salesforce developers writing Apex code stand to gain by learning more about lazy functions? Fluent interfaces -- or objects that return themselves during function calls -- also tend to satisfy one of the prerequisites...| www.jamessimone.net
Batchable and Queueable Apex are both powerful processing frameworks within Salesforce. Unlock the power of both Batchable and Queueable Apex with the easily extendable DataProcessor pattern.| www.jamessimone.net
Learn more about performance testing the CRUD framework, the cost of sorting, and how to implement custom sorting easily.| www.jamessimone.net