Question 1 of 30
In a Salesforce development environment, a team is tasked with refactoring a legacy Apex class that has grown unwieldy over time. The class currently contains multiple methods that handle various business logic, leading to difficulties in testing and maintenance. The team decides to implement the Single Responsibility Principle (SRP) to improve code quality and maintainability. Which of the following strategies best exemplifies the application of SRP in this scenario?
Splitting the existing class into several smaller classes, each responsible for a distinct piece of functionality, such as data retrieval, processing, and validation.
Consolidating all methods into a single class to reduce the number of files and improve accessibility.
Adding comments to each method to clarify their purposes without changing the structure of the class.
Creating a single utility class that contains all the methods from the legacy class to centralize functionality.

Preparing for SalesForce Certified Platform Developer II Certified Platform Developer II? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free