Client server communication
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 Force.com 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 example, the Visualforce apex:commandButton
and apex:actionFunction
(AJAX) components do an excellent job of handling this for you, resulting in your Apex code being called with very little effort on your behalf apart from simply using these components. Salesforce also takes care of the security aspects for you, ensuring that the user is logged in, and has a valid session to make the request to the server. For Lightning Components, there are no direct equivalent components through the component markup. Instead, the $A.enqueueAction
JavaScript method can be called from a component's client-side controller method to access the Apex...