Implementing design guidelines
The methods in the Selector classes encapsulate common SOQL queries made by the application, such as selectById
, as well as more business-related methods, such as selectByTeam
. This helps the developers who consume the Selector classes to identify the correct methods to use for the business requirement and avoids replicating SOQL queries throughout the application.
Each method also has some standard characteristics, such as the SObject
fields selected by the queries executed, regardless of the method called. The overall aim is to allow the caller to focus on the record data returned and not how it was read from the database.
Security conventions
As stated in the previous chapter, it is good practice to follow the principle of least privileged execution and the sample application used in this book enforces this by changing the default configuration of the Enterprise Apex Patterns library it uses. Thus, every Selector class in the sample application...