Fundamentally, any communication between the user's chosen device (client) and the data and logic available on the Salesforce server occurs using the HTTP protocol. As a Lightning developer, you rarely get involved with the low-level aspects of forming the correct HTTP POST or HTTP GET request to the server and parsing the responses:
- For Lightning Aura Components, the $A.enqueueAction JavaScript method can be called from a component's client-side controller method to access the Apex code.
- For Lightning Web Components, the @wire protocol can be used to bind properties in your client-side controller to methods in your Apex code.
- For Visualforce, the apex:commandButton and apex:actionFunction components can be used to invoke Apex code.
Salesforce also takes care of the security aspects for you, ensuring that the user is logged...