Search

Quirky Apex

Developer related topics for the Salesforce.com platform

Author

Adam

FFLIB – Application structure

We’ve covered all of the layers so far in use when using FFLIB. Here’s a quick overview of the different layers again.

  • Selector – all of your queries go into this layer.
  • Domain – the layer which contains reusable pieces of code for working with sObjects and is the entry point for handling trigger events.
  • Service – business logic orchestration layer which can be called from anywhere in your application.
  • Unit of work – a pattern for managing transactions on the platform.

In this blog post I’m going to cover how to “stitch” all of those layers together to produce a rock solid code base and have an application structure which is properly set up.

Continue reading “FFLIB – Application structure”

ApexMocks – Argument Capture

In this blog post I’m writing about ApexMocks and one particular feature which I found extremely useful, argument capture. Argument capture can really enhance your unit testing capabilities within FFLIB and ApexMocks based projects.

Continue reading “ApexMocks – Argument Capture”

A really useful plugin for hiding away all of the metadata XML files whilst you’re developing in Sublime 3 is ToggleExclude. Check out the package listing over on PackageControl.io to see how it can really help with helping you focus on the files which matter when developing.

https://packagecontrol.io/packages/ToggleExclude

Below is my configuration file for hiding away Apex class, Trigger, Visualforce Page, Visualforce Component and Lightning Component metadata files.

{
   "conditional_file_exclude_patterns": [
      "*.cls-meta.xml",
      "*.component-meta.xml",
      "*.page-meta.xml",
      "*.trigger-meta.xml",
      "*.cmp-meta.xml"
   ],
   "enabled": true
}

An approach to reusing Lightning Components

In this blog post I’m going to show you how to increase the usability of your Lightning Components in your application by decoupling responsibilities and enforcing separation of concerns.

Continue reading “An approach to reusing Lightning Components”

Fast Simple Unit Testing

Fantastic video from Salesforce explaining how to use the ApexMocks framework and the new Stub API. Highly worth watching if you’re interested in speeding up your unit tests or considering using the FFLIB framework.

Just passed the Community Cloud Consultant exam!

SFU_CRT_BDG_Comm_Cld_Cnsltnt_RGB.jpg

What I liked about this exam is that it forces you to look into functionality not commonly used within communities, such as topics or reputation and even moderation. It’s a valuable certificate to attain for opening your eyes to other areas of the platform you may not be so familiar with!

Speeding up Lightning Components

One thing I hear from time to time is that Lightning Components can be a little slow, especially when rendering dynamic data. In this blog post I’m going to share some thoughts and approaches on how to speed up rendering times and improve the usability of your applications.

Continue reading “Speeding up Lightning Components”

A fantastic new feature in Summer ’17 release of Salesforce now allows you to define which unit tests can safely be run in parallel!

If you’ve disabled running parallel unit testing in your Salesforce org because of issues with concurrency (i.e. UNABLE_TO_LOCK_ROW exception) then this update is for you! You can still keep running of unit tests in parallel disabled, but you can now optionally indicate which unit tests can be run in parallel.

To do this, modify the annotation on your unit tests to include the following new parameter.

@isTest(isParallel=true)

This should drastically speed up running of your unit tests in your Salesforce org! Find more on this in the Salesforce documentation:

https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_runTestsSynchronus_describe_cruc.htm?edition=&impact=

Sharing JavaScript code across Lightning Components

The problem

Sometimes it can be a little frustrating when developing Lightning Components because you want to follow the DRY principle (Don’t Repeat Yourself) because the framework does not yet offer a suitable way of accessing a shared library of code. There is a solution available in the open source version, but it’s not yet available on the platform.

Continue reading “Sharing JavaScript code across Lightning Components”

Create a website or blog at WordPress.com

Up ↑