Thursday 6 September 2012

Using Standard Controllers - Visualforce


Visualforce’s Model-View-Controller (MVC) design pattern makes it easy to separate the view and its styling from the underlying database and logic. In MVC, the view (the Visualforce page) interacts with a controller. In our case, the controller is usually an Apex class, which exposes some functionality to the page. For example, the controller can contain the logic to be executed when a button is clicked. A controller also typically interacts with the model (the database)—making available data that the view might want to display.
Most Force.com objects have default standard controllers that can be used to interact with the data associated with the object, so in many cases you don’t need to write the code for the controller yourself. You can extend the standard controllers to add new functionality, or create custom controllers from scratch. In this tutorial, you’ll learn about the standard controllers.

No comments:

Post a Comment