The implementation of the Domain class in this chapter utilizes the Financial Lightning Apex Enterprise Patterns library, which is open source and is included in the sample code of this chapter. In this library, the Apex base class, fflib_SObjectDomain, is provided to help implement the Domain layer pattern.
A basic template for a Domain class utilizing this base class is shown in the following code snippet:
public inherited sharing class Races extends fflib_SObjectDomain { public Races(List<Race__c> races) { super(races); } public class Constructor implements fflib_SObjectDomain.IConstructable { public fflib_SObjectDomain construct(
List<SObject>sObjectList) { return new Races(sObjectList); } } }
The first thing to note is that the constructor for this class takes a list of Race__c records, as...