Skip to content

Why I need Selector Layer? #432

Closed Answered by daveespo
pgajek2 asked this question in Q&A
Discussion options

You must be logged in to vote

This topic has been discussed many times -- both publicly and within countless engineering teams.

The short answer to the lengthy discussion is that Selectors promote consistency. That is, without a centralized layer to access your data, inconsistencies can creep into your application because different conditions are used for filtering records. And, in the Salesforce case, you retrieve different "shapes" of records (different fields are selected) and find yourself with runtime bugs when fields are accessed without being explicitly queried for. Fowler's Enterprise Patterns book is a good read if you are looking for the non-Salesforce explanation: https://martinfowler.com/eaaCatalog/tableDa…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by daveespo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants