Visualforce Controller
In Salesforce Visualforce development, an Apex class that provides the data and handles user actions for a Visualforce page, available as standard controllers (auto-generated for objects) or custom controllers written in Apex.
Definition
In Salesforce Visualforce development, an Apex class that provides the data and handles user actions for a Visualforce page, available as standard controllers (auto-generated for objects) or custom controllers written in Apex.
In plain English
“A Visualforce Controller is an Apex class that provides data and handles user actions for a Visualforce page. You can use standard controllers (automatic CRUD for one object), custom controllers (full custom logic), or controller extensions (adding to standard controllers).”
Worked example
When a developer at Underwell Hospitality builds a custom Visualforce page for booking review, she has three options for the Visualforce Controller. A Standard Controller (controller="Booking__c") gives her free CRUD on a single record. A Custom Controller (a from-scratch Apex class) gives her full control over data and logic. A Controller Extension (extending the Standard Controller with a custom Apex class) gives her the standard CRUD plus added custom methods. She picks the Controller Extension - keeps Salesforce's record-retrieval and save-button behavior for free, adds her custom calculation logic. Controllers are the back-end half of every Visualforce page; the markup is the front-end.
Why Visualforce Controller matters
In Salesforce Visualforce development, a Visualforce Controller is an Apex class that provides the data and handles user actions for a Visualforce page, available as standard controllers (automatic CRUD), custom controllers (full custom logic), or controller extensions (adding capabilities to standard controllers).
Controllers are the server-side logic behind Visualforce pages. Standard controllers handle basic CRUD automatically; custom controllers give full control over page behavior; extensions add custom functionality to standard controllers. Mature Visualforce development chooses the right controller type based on complexity needs.
How organizations use Visualforce Controller
Uses standard controllers for simple CRUD pages and custom controllers for complex logic.
Extends standard controllers when additional logic is needed beyond basic CRUD.
Chooses controller type based on page complexity requirements.
Trust & references
Straight from the source - Salesforce's reference material on Visualforce Controller.
- Standard ControllersSalesforce Developers
- Custom ControllersSalesforce Developers
🧠 Test your knowledge
Q1. What is a Visualforce Controller?
Q2. What types exist?
Q3. When use a standard controller?

Discussion
Loading discussion…