Universal Containers has implemented a strict software architecture for their custom Apex code. One of the requirements is that all SOQL queries are contained within reusable classes. Depending on the context of the Apex transaction, the queries should be able to run either "With Sharing" or "Without Sharing". Which two ways allow the Architect to meet these requirements.

Respuesta :

Answer:

The required coding for the architect to meet these requirement has been described below.

Explanation:

The following ways will help the architecture to meet the requirement.

Create a reusable SOQLQueries class; specify “With Sharing” on the methods that require user context and “Without Sharing” on the methods requiring system context.

Create a SystemSOQLQueries class and a UserSOQLQueries class; set the “With Sharing” keyword on the UserSOQLQueries class and “Without Sharing” on the SystemSOQLQueries class.