Notifications
Clear all

According to SFRA best practices, what is the correct approach to improve code reusability in this scenario?

1 Posts
1 Users
0 Likes
74 Views
(@colmenerocarmelo)
Posts: 746
Noble Member
Topic starter
 

A developer needs to perform the same additional checks before completing multiple routes in a custom controller, in order to decide whether to render a template or redirect the user to a different page.

According to SFRA best practices, what is the correct approach to improve code reusability in this scenario?

  • A . Define a new middleware function and use it in the existing routes.
    B. Append a new function to all the existing routes with the server module.
    C. Replace the existing routes by creating a controller in separate new cartridge.
    D. Use the superModule property in the existing routes to extend their functionality.

Show Answer Hide Answer

Suggested Answer: A
 
Posted : 18/01/2023 5:10 am

Latest Salesforce Certified B2C Commerce Developer Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: