A Selector class, like the Domain class, utilizes inheritance to gain some standard functionality. In this case, the base class, delivered through the FinancialForce.com Enterprise Apex Patterns library, fflib_SObjectSelector, is used to reduce the coding overhead in performing queries, adding some standard behaviors, and supporting best practices. These will be discussed in further detail throughout this chapter.
A basic example of a Selector class for querying Races is as follows:
public inherited sharing class RacesSelector
extends fflib_SObjectSelector { public List<Schema.SObjectField> getSObjectFieldList() { return new List<Schema.SObjectField> { Race__c.Id, Race__c.Name, Race__c.Status__c, Race__c.Season__c, Race__c.FastestLapBy__c, Race__c...