10 December 2013

Explaining about Controllers and those types?

I here to discussing about definition of controllers and different types of controllers available in salesforce.com.
Controllers :
Ans :
-  It is a set of instructions define how to control the fields,links and buttons etc. should behave inside the Visualforce page.
- Controllers also provide access to the data that should be displayed in a page and can modify component behavior.
- Controllers can be categorized into four types.They are 
  1.  Standard Controller
  2. Custom Controller
  3. Extension Controller
  4. List Controller
1.Standard Controller :
                               It is one that help us to carry forward the functionality of an object that has been defined by us using the Declarative method.i,e it helps us to " leverage the standard functionality of an object from the declarative method to programmable method."
For Example : if we use the standard accounts controller,clicking a save button in a visual force page results in the same behavior as clicking save on a standard account edit page.

2.Custom Controller :
                             It is a class written in Apex that implements all of a page logic.
If we use custom controller,we can define new navigation elements or behaviors,but we must also re implement any functionality that was already provided in a standard controller.

3.Extension Controller :
                            It is a class written in Apex that adds to or overrides behavior in a standard or custom controller.
Extensions allow us to leverage the functionality of another controller while adding our own custom logic.

4.List Controller :
                            This is very similar to Standard Controller.Standard list controllers allow you to create Visualforce pages that can display or act on a set of records.
-  Examples of existing Salesforce pages that work with a set of records include list pages, related lists, and mass action pages.
-  Standard list controllers can be used with the following objects:
Account       Asset         Campaign    Case    Contact      Idea      Lead      Opportunity    Order
Product2     Solution      User            Custom objects.

No comments:

Post a Comment