Salesforce Certified Development Lifecycle and Deployment Architect — Question 49
The opportunityService and opportunityServiceTest classes are in package A but are used only in package B. Both second-generation packages have the same namespace. Therefore, they should be moved to package B for better organization and control.
What should the architect recommend for this process?
Answer options
- A. Move the classes of package A to package B and change the code for package B that called this class from package A.
- B. Set the classes as deprecated in package A and recreate them in package B with new names.
- C. Move the classes of package A to package B and create new package versions.
- D. Set the classes as deprecated in package A and recreate them in package B.
Correct answer: A
Explanation
The correct answer is A because moving the classes to package B and updating the code ensures that all references are correctly aligned with the new location, maintaining functionality. Options B and D unnecessarily complicate the process by introducing deprecation and renaming, which can lead to confusion and additional work. Option C suggests creating new package versions, which is not necessary for simply relocating classes within the same namespace.