Lightning Web コンポーネントを構築するときに、データ取得で最高のパフォーマンスを得るために開発者が実装する必要がある 3 つのアプローチはどれですか? 3 つの答えを選択してください
正解:A,C,E
To obtain the best performance for data retrieval when building a Lightning web component, the developer should implement three approaches: use lazy load for occasionally accessed data, use the Lightning Data Service, and use {cacheable=true} whenever possible. Lazy loading is a technique that loads data on demand, instead of loading all the data at once. This can improve the responsiveness and performance of the component, as it reduces the network traffic and processing time. The developer can use the enable-infinite-loading attribute of the lightning-datatable component to implement lazy loading for large data sets. The Lightning Data Service is a layer of the Lightning Platform that provides access to Salesforce data and metadata, cache management, and data synchronization. The developer can use the Lightning Data Service to retrieve and manipulate data without writing Apex code or making server calls. The developer can use the @wire decorator or the uiRecordApi service to access the Lightning Data Service. The {cacheable=true} annotation is used to mark an Apex method as cacheable, which means that the method can be invoked by a Lightning web component that uses the @wire decorator. This can improve the performance of the component, as it reduces the number of server trips and leverages the client-side cache. The developer should use this annotation whenever possible for methods that return data that does not change frequently or does not depend on the user context. Reference: [Lazy Loading in Lightning Web Component], [Lightning Data Service Basics], [Call Apex Methods from Lightning Web Components]