function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Murali KrishnaMurali Krishna 

what is the difference between controller and apex class

what is the difference between controller and apex class?

Best Answer chosen by Admin (Salesforce Developers) 
ryanjuptonryanjupton

They are NOT the same. A Controller is an Apex Class but an Apex Class is not always a Controller. You can create Apex as helper classes to Triggers and helper classes to Controllers to create a more modular, reusable solution to complex problems. Apex classes also are used for batch data operations and creating REST and SOAP Web Services.  Apex classes provide a way to also create a polymorphic structure to your code and implement many design patters on the Force.com platform. There's a good general description here: http://www.salesforce.com/us/developer/docs/apexcode/ and more specifically here: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_invoking.htm

All Answers

sandeep@Salesforcesandeep@Salesforce

There is not difference. both are same.

ryanjuptonryanjupton

They are NOT the same. A Controller is an Apex Class but an Apex Class is not always a Controller. You can create Apex as helper classes to Triggers and helper classes to Controllers to create a more modular, reusable solution to complex problems. Apex classes also are used for batch data operations and creating REST and SOAP Web Services.  Apex classes provide a way to also create a polymorphic structure to your code and implement many design patters on the Force.com platform. There's a good general description here: http://www.salesforce.com/us/developer/docs/apexcode/ and more specifically here: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_invoking.htm

This was selected as the best answer
Murali KrishnaMurali Krishna

Thanks every body