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
nagamalli tadikondanagamalli tadikonda 

regarding controllers

what is difference between standardcontroller, standardsetcontroller, customcontroller, extension ?
Amit Singh 1Amit Singh 1
Hi Nagamalli,

1 - StandardController is auto generated by Salesforce for all Object like Account, Opportunity, Test_Obj__c.
2 - customcontroller  is used when we do not want to use any Standard Controller.
3 - extension are used to extend the functionality while using a standard controller or standard controller. We can use more than one extension in same VF page.
4- StandardSetController objects allow you to create list controllers similar to, or as extensions of, the pre-built Visualforce list controllers provided by Salesforce.

Instantiation
You can instantiate a StandardSetController in either of the following ways:
  • From a list of sObjects:
  • List<account> accountList = [SELECT Name FROM Account LIMIT 20];
    ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(accountList);
  • From a query locator:
  • ApexPages.StandardSetController ssc = 
    new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Name,CloseDate FROM Opportunity]));

Also, I have compiled some links that are given below:

http://salesforce.stackexchange.com/questions/4041/difference-between-controller-and-extensions

http://www.infallibletechie.com/2012/11/difference-between-standardcontroller.html

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_pages_standardsetcontroller.htm


Go through with the above links and you will get your answer.

Thanks,
Amit
Anilkumar KotaAnilkumar Kota
Please check below post for same
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller.htm
2) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_extension.htm

User-added image

Standard - these are provided by the platform so you can produce Visualforce pages without writing code. You'd use these when you have a singe object to manipulate. It provides a save method to allow you to persist changes. There's a variant of this that handles a collection of records - the standard list controller.
Custom controller - this is written in Apex and requires you to write code for any behaviour you ned. You'd use these when your page isn't dealing with a main object - e.g. A launch pad that can take you to a number of different sub pages.
Extension controller. This provides additional functionality to a controller - either a standard controller (e.g to manipulate child records along with a parent) or a custom controller (this is often overlooked and is a way to provide common functionality across a number of pages).

1)http:// http://www.salesforcetutorial.com/custom-controllers-controller-extensions/ (http:// http://www.salesforcetutorial.com/custom-controllers-controller-extensions/)