Which three operations should be done in a controller?
Choose 3 answers
A.
Generate the response as JSON or HTML
B.
Use the Script API to generate data for the view.
C.
Use middleware functions when applicable
D.
Create a plain JavaScript object representing a system object
E.
Use the model needed for the view.
The Answer Is:
A, B, E
This question includes an explanation.
Explanation:
In Salesforce B2C Commerce, controllers are responsible for handling application logic and responding to user requests. The operations best suited to be done in a controller include: A. Generate the response as JSON or HTML - Controllers handle the final rendering of data in the desired format for the client, whether as web pages (HTML) or data endpoints (JSON). B. Use the Script API to generate data for the view - Controllers often leverage server-side Script APIs to fetch or manipulate data necessary for the view. E. Use the model needed for the view - It is a common practice to construct models that encapsulate data and business logic which are then passed to the view for rendering, keeping views clean and focused solely on presentation.
B2C-Commerce-Developer PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 60% Discount on All Products,
Use Coupon: "8w52ceb345"