Question 410
An AL extension team encounters the following situation: A rules engine needs different tax calculation behaviors across countries without a large switch statement in every caller. Which technical principle best explains the relevant risk or failure?
Explanation
Correct Answer
This is the controlling principle in the reported case. Interface-based dispatch allows multiple implementations behind a consistent contract. The intended remedy is define an AL interface and separate codeunits implementing the country-specific behavior.
Incorrect Answers
This alternative addresses the separate case “A company upgrades an app and must transform old shipment flags into a new status enum while preserving records”. App version upgrades may need explicit conversion of persisted data. The deciding requirement here is “Interface-based dispatch allows multiple implementations behind a consistent contract”.
The option would apply to “A developer subscribes to an event but the event never fires because the subscriber names the wrong publisher signature”. The underlying mechanism is that event subscriptions require matching published signatures and available event surfaces. This question instead requires “Interface-based dispatch allows multiple implementations behind a consistent contract”.
The related but distinct situation is “A partner's event subscriber updates the same record and recursively triggers the event again”. The underlying mechanism is that event handlers can create loops if side effects retrigger the same notification. For the stated problem, “Interface-based dispatch allows multiple implementations behind a consistent contract” addresses the central condition.