B2C-COMMERCE-ARCHITECT practice question 4 of 15

An ecommerce site has dynamic shipping cost calculation. it allows the customers to see their potential shipping costs on the Product Detail Page…

Full set: 64 questions
An ecommerce site has dynamic shipping cost calculation. it allows the customers to see their potential shipping costs on the Product Detail Page before adding an item to the cart. For this feature, shipping touts are calculated using the following logic: • Set the shipping method on the Basket • Add the item to the basket, calculate the basket total and get the shipping cost for this method • Remove the item from the Basket to restore the original state • The above process is repeated for each shipping method During the testing it was discovered that the above code violates the spi.basket.addResolveInSameResquest quota. What should the Architect do to resolve this issue and maintain the business requirement?
Answer options
A: Omit the removal of the Item and speed up the process for the customer by adding the product to the basket for them.
B: Omit the calculation of shipping cost until the customer is ready to check out and has chosen the shipping method they want to
C: Wrap each Individual step of the process its own transaction Instead of using one transaction for all steps.
D: Wrap the adding of product and shipping cost calculation in a transaction which Is then rolled back to restore the original state Correct answer
Correct Answer:
D. Wrap the adding of product and shipping cost calculation in a transaction which Is then rolled back to restore the original state
Explanation

To resolve the issue of violating the spi.basket.addResolveInSameRequest quota and to maintain the functionality of dynamically calculating shipping costs for items before they are added to the basket, the best approach is:
Option D: Wrapping the adding of product and shipping cost calculation in a transaction, which is then rolled back to restore the original state. This method ensures that the system can calculate potential shipping costs without permanently altering the state of the basket. This approach keeps the basket's original state intact while allowing for multiple shipping calculations, effectively managing the load on system resources and adhering to platform quotas.

Scroll to Top