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
.
A basic example is as follows:
public 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.PollPositionLapTime__c, Race__c.TotalDNFs__c }; } public Schema.SObjectTypegetSObjectType() { return Race__c.sObjectType; } }