A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk. Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the front desk. What should be used?
18
In the Aura Component framework, communication between components is handled via events. When two components need to communicate but do19 not share a direct parent-child relationship---such as a kiosk registration component on a page and an alert component residing in the global utility tray---an Application Event (Option C) is required.
Application events follow a 'publish-subscribe' model. One component fires the event, and any other component in the application that has a handler for that specific event type can listen for and react to it, regardless of where they sit in the component hierarchy. This is distinct from a Component Event (Option D), which is restricted to bubbling up the component containment hierarchy (from child to parent).
While modern implementations might also consider the Lightning Message Service (LMS) for cross-framework communication (between Aura, LWC, and Visualforce), within the specific context of Aura-to-Aura communication for decoupled components like utility bar items, Application Events remain the fundamental architectural solution. DML Operations (Option A) and ChangeLogs (Option B) are database-level concepts and do not provide the real-time, client-side notification capabilities needed for a UI alert system.
==========
Currently there are no comments in this discussion, be the first to comment!