Saturday, 5 November 2011
MVC Design Architecture
Controller: Whenever the client/user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data (db), the controller is responsible for directing the appropriate view to the user. In GUIs, the views and the controllers often work very closely together.
Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.
View : The view represents the presentation of the application. The view object refers to the model/data. It uses the query methods of the model/data to obtain the contents and renders it.
In Salesforce:
Model refers Objects/fields
View refers VF Pages/CSS
Controller refers VF Controller/Apex Code
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment