Quirky Apex

Developer related topics for the platform



The new Apex stub API

It’s finally generally available with the Spring ’17 release; the Apex stub API! This is really going to make your unit tests easier to write and enable you to write more meaningful tests.

In this post I’ll cover why this is such a big deal and how you can incorporate it into your unit tests going forward.

Continue reading “The new Apex stub API”

Queueable callouts in Apex just became even better in the latest release of Salesforce as you can now make webservice callouts in chained queueable callouts!

The under used String.format

As developers we are frequently capturing data from form input, validating and displaying errors back to the user when validation criteria are not met. Other times we have to create strings such as URL’s with dynamic parameter values or even queries with dynamic where clauses.

In this blog post I want to demonstrate a much better approach on how to create dynamic error messages or even other types of strings using the under used String.format method.

Continue reading “The under used String.format”

Make unit testing even easier with a new pilot from Salesforce, a new mocking API.

This is going to be really interesting how it affects existing projects such as FFLIB Apex Commons and ApexMocks which offer similar functionality.

FFLIB – Service layer

This is the next in the series covering FFLIB and the enterprise design patterns. Previously I covered the unit of work pattern (UOW).

As mentioned in my introduction to FFLIB, the service layer is where we will place all of our business logic in our application. Think of the service layer of where you orchestrate all of your business logic.

It aims to solve one of the more common issues in larger applications, whereby logic becomes scattered or even worse, duplicated. By keeping our business logic defined in central place we encourage reuse and reduce logic from being scattered, increasing maintainability.

Continue reading “FFLIB – Service layer”

FFLIB – Unit of work

This is the next in the series of FFLIB posts in which I’m trying to cover in the upcoming months. In my last post I covered the selector layer and how it can really help centralise your queries in your application. The next logical layer in FFLIB to cover now is the unit of work pattern

The unit of work pattern (UOW) is aimed at solving some of the common design issues in Salesforce applications when dealing database operations and bringing additional functionality to make your life as a developer much easier.

Continue reading “FFLIB – Unit of work”

FFLIB – Selector layer

This is the next post in a series of posts covering how to use FFLIB in your project. In this post we will be covering the selector layer, the part of the application which handles all of your queries. Last time we covered a basic introduction to the domain layer.

Continue reading “FFLIB – Selector layer”

FFLIB – Domain layer

In my previous blog post I gave a basic introduction as to what FFLIB is and why it’s a good idea to use such a framework in your project.

This time I’d like to give a more technical introduction into the domain layer and give examples on how to use it.

Continue reading “FFLIB – Domain layer”

Code commenting is a must but it can be a chore to create class and method comment blocks. Use DocBlokr to make your coding life easier.

Create a website or blog at

Up ↑