Visualforce Controller Architecture
In our previous Salesforce Tutorial we have learned about Salesforce Model View Controller(MVC) architecture.In this Salesforce Training Tutorial we are going to learn about Visualforce Controller Architecture.
Visualforce Controller Architecture
In controller architecture we have three blocks they are.
- User.
- Internet.
- Force.com Platform.
User :- User sends request and get results on User Interface.
Internet :- Internet is the medium between user’s and Fore.com.
Force.com platform :- Force.com platform is the that where developer develop applications.
Controller Architecture diagram is as shown above. MVC Architecture and Controller Architecture is similar with each other. When coming to visualforce controller Architecture, generally user’s are the one who request visualforce page primarily that references custom controllers.
Let us see what is going to happen in Visualforce Controller Architecture. Controller attribute is referencing a class and calls the constructor associated with that class instantiated object. Now visualforce page is going to call “Gather(Get method)” and user user will be returned with “HTML Page”. This HTML page will have some functions like buttons, links, action functions and so on. When a user clicks on a button then action method will be called to do some logical functions and returns another Standard Visualforce page.
From above diagram in force.com platform we can observe a block called “View State”. View state is that which stores user’s sessions and restore the data when a user request previous page.