Today one of my blog visitor asked me, how do Lightning Components interact with Salesforce? How does Lightning component get data from server? I thought to write an article on this, it might help you also to understand the architecture of Lightning Component Framework.
Below image will help you in understanding this.
- Whenever a Lightning Component or an App runs on browser of Mobile device, it first download all component resources(i.e. Styles, Scripts, Markup) on mobile device. They are contained in browser’s memory to support display and processing that is why we call it client-side.
- This HTTP request to call apex method will be asynchronous. Asynchronous means you will make the request and forget about it and the controller returns to the client. The processing will be done on server-side.
- In the meantime Salesforce processes the logic by executing some apex.
Hope this will be helpful 🙂