Posts Tagged development

The Failure of the Knowledge Transfer

With any long-running software project, the need to educate others on a block of code, architectural design, or business process will likely occur. These knowledge transfers (or KTs as the cool kids call them) are often needed when a developer or subject matter expert leaves the project (sometimes unexpectedly) or when a project wraps up and is handed off to the client.

The goal is simple - make Person A understand something to the same degree that Person B does. And this sounds appropriate, right? Why wouldn’t you educate the team or client on the inner-workings of a project? There’s nothing wrong with the idea; the problem is, knowledge transfers just don’t work (usually).

Read More

Logging Salesforce errors with platform events

The following pattern is fairly common in other technologies:

  try {
    doSomethingRisky();
  } catch (Exception e) {
    logException(e);
    throw e;
  }

This won’t work in salesforce. By rethrowing the exception (assuming it’s not caught further up the call stack), the database transaction will be rolled back - that includes whatever insert or update ws triggered in logException(e). So how do we ensure that the logging occurs in a separate database transaction? The answer is a platform event!

Read More

HTTP Mock Registry - A Simplified Way to Mock Apex Callouts

Apex leaves much to be desired when it comes to mocking callouts to external services. Use of the HttpCalloutMock interface requires that a test author configure mock responses for ALL callouts made through the course of a test’s processing, and this can be quite unmanageable in large or complex projects. There must be a better way… Enter the HTTP Mock Registry.

Frustrated with messy tests and abstraction leaks, we’ve devised a utility that provides a intuitive interface for mocking callouts declaratively as well as a foundation for more modular test suites whenever callouts are involved.

Read More

A Better Way to Communicate from Child to Parent Aura Components

Being able to invoke methods and pass data between parent and child components is critical when building an application structure that is both extensible and easy to use.

One of the basic features of Lightning Aura components is the ability to nest components (components containing other components). Communicating from a Parent Component to a Child Component is easy with Aura.

Read More