I found a good page in the Eclipse Help pages for Force.com which explains the architecture of a controller extension and custom controller. These are the steps (in general) that happens when a VIsualforce page is requested, loaded, managed and closed.
1. User requests a page
ONLOAD: 2. The constructors are called for a possible associated controller or controller extension. 3. The assignTo attributes on any custom components on the page are executed 4. Expressions are evaluated. 5. The action attribute on the page tag component is called. 6. Other method calls are made (getter and setters). 7. The resulting HTML is sent to the browser.
POSSIBLE ACTIONS: 8. If the page contains a form component, the view state i updated whenever the page is updated 9. As the user interacts with the page, action methods and getter and setters methods are called as the page contacts the controller as required.
CLOSING: - When the user is redirected to another page, the view state and controller objects are deleted. |