apex-enterprise-patterns / fflib-apex-common-samplecode

Samples application illustrating the Apex Enterprise Patterns library
BSD 3-Clause "New" or "Revised" License
206 stars 105 forks source link

Question about SOQL query in QuickOpportunityWizardController #54

Closed jeff-steinberg-northsight closed 3 months ago

jeff-steinberg-northsight commented 3 months ago

Just wondering why this class has a SOQL query in it instead of creating a selector for OpportunityLineItems? Are there certain situations where a selector class should not be used? Since the query retrieves values from PricebookEntry, seems like it could be a good example for showing how to use relationship queries in a selector class.

daveespo commented 3 months ago

The sample code here is 11 years old so it's hard to know the "why" -- but there is a code comment above that controller action method that says This controller is not using the pattern approach in this code sample version. See the other two controllers in this sample for an illustration of how the patterns are used

So it seems like Andy acknowledged up front that the sample code is not a good example of adopting the Apex Enterprise Patterns.