SoC and the Apex Common Library Tutorial Series Part 6: The fflib_SObjectUnitOfWork Class
| |

SoC and the Apex Common Library Tutorial Series Part 6: The fflib_SObjectUnitOfWork Class

What is the fflib_SObjectUnitOfWork class? It is a foundation built to allow you to leverage the unit of work design pattern from within Salesforce. Basically this class is designed to hold your database operations (insert, update, etc) in memory until you are ready to do all of your database transactions in one big transaction. It…

SoC and the Apex Common Library Tutorial Series Part 5: The Unit of Work Pattern
| |

SoC and the Apex Common Library Tutorial Series Part 5: The Unit of Work Pattern

What is the Unit of Work Pattern (UOW) A Unit of Work, “Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems”. The goal of the unit of work pattern is to simplify DML in your code and only commit changes to…

SoC and the Apex Common Library Tutorial Series Part 4: The fflib_Application Class
| |

SoC and the Apex Common Library Tutorial Series Part 4: The fflib_Application Class

What is the fflib_Application class? Quality question… I mean honestly wtf is this thing? Lol, sorry, let’s figure it out together. The fflib_Application class is around for two primary purposes. The first is to allow you an extremely abstract way of creating new instances of your unit of work, service layer, domain layer and selector…

SoC and the Apex Common Library Tutorial Series Part 3: The Factory Method Pattern
| |

SoC and the Apex Common Library Tutorial Series Part 3: The Factory Method Pattern

What is the Factory Method Pattern? The factory method pattern allows you to create objects (or instantiate classes) without having to specify the exact class that is being created. Say for instance you have a service class that can be called by multiple object types and those object types each have their own object specific…

SoC and the Apex Common Library Tutorial Series Part 2: Introduction to the Apex Common Library
| |

SoC and the Apex Common Library Tutorial Series Part 2: Introduction to the Apex Common Library

What is the Apex Common Library? The Apex Common Library is an open source library originally created by Andy Fawcett when he was the CTO of FinancialForce and currently upkept by many community members, but most notably John Daniel. Aside from its origins and the fflib_ in the class names, it is no longer linked…

SoC and the Apex Common Library Tutorial Series Part 1: Introduction to the Separation of Concerns Design Principle
| |

SoC and the Apex Common Library Tutorial Series Part 1: Introduction to the Separation of Concerns Design Principle

What is the Separation of Concerns Design Principle? Basically separation of concerns is the practice of putting logical boundaries on your code. Putting these logical boundaries on your code helps make your code easier to understand, easier to maintain and much more flexible when it needs to be altered (and every code base ever has…

Salesforce Development Tutorial(LWC): How to Generate a Word Document from a Lightning Web Component
|

Salesforce Development Tutorial(LWC): How to Generate a Word Document from a Lightning Web Component

[sm-youtube-subscribe] Why Create an LWC that can Generate Word Documents? This is a little more self explanatory than many of the blog posts I do, but let’s go over some things. You typically wanna create this because the business has a need (for one reason or another) to generate a word doc. I’ve had businesses…

Salesforce Development Tutorial: How to use the Safe Navigation Operator in Apex to reduce the amount of null checking in your codebase
|

Salesforce Development Tutorial: How to use the Safe Navigation Operator in Apex to reduce the amount of null checking in your codebase

Why use the Safe Navigation Operator?? My guy, this is the best thing Salesforce has added to the Apex language in forever! Embrace it! To elaborate on that though, let me hit you with this thrilling sales pitch. Just imagine a late night commercial selling you garbage, but the garbage is actually good. Are you…

Salesforce Development Tutorial: How to use Named Credentials to simplify your Apex Salesforce Integrations
|

Salesforce Development Tutorial: How to use Named Credentials to simplify your Apex Salesforce Integrations

Why should you bother using Named Credentials? In short, it’s gonna save you a bunch of time, code and unnecessary configuration, especially when you are authenticating using OAuth. Named credentials basically simplify the authentication portion of your callouts to to external services and allow you do it declaratively through configuration. No matter how hardcode a…

Salesforce Development Tutorial: How to Implement a Trigger Framework
|

Salesforce Development Tutorial: How to Implement a Trigger Framework

Why use a Trigger Framework? There are a couple big reasons why you would want to implement a trigger handler. Let’s check them out below: 1) It makes your triggers way easier to test. By putting your logic in your trigger handler, instead of your trigger you allow yourself a much simpler path to testing…