MVC pattern is a software architectural pattern commonly used in many technology platforms including Salesforce. Model stands for data, View stands for User interface, and Controller stands for the Processor. The Controller processes the data and display it on the user interface. Let us look into detail the MVC architecture in Salesforce scenario.
- Model in Salesforce refers to Objects or Apex classes in which the data resides.
- View refers to Standard salesforce pages and the Visual force pages.
- Controller refers to Standard Controller and Custom controller
- The Controller selects the View based on the user actions performed and it also update the model based on the same.
- The Model triggers the view to update and the View queries model for state.
Salesforce development is performed in two ways. The one which uses point and click method without using coding is called declarative programming. Second method involves the development of application with the help of coding and is called Programmatic development. We can obtain an easy understanding of MVC pattern from the following break up of each components.
- Model indicates the data base aspect of salesforce.
- It includes Standard and custom objects, Fields and Relationships and everything associated with them. These are declarative in nature.
- Salesforce provides inbuilt feature like standard objects and standard fields.
- Salesforce admins can create and configure custom objects and custom fields, build relationships, dependencies, without using complex programs.
- The programmatic counterparts include Metadata API, REST API, Bulk API
- The programmatic options are used where the declarative options cannot be used.
- Similarly in several scenarios, like building relationships, the declarative option is used since it is very complex to accomplish through programming.
To learn more about APIs, click API Library | Salesforce Developers
- Declarative options of Salesforce includes the Page Layouts and Record types.
- These can be customised.
- Salesforce administrators and consultants handle these.
- The Programmatic options refers to the Visual force pages which are programmed by salesforce developers.
- Visual force pages can override the standard webpages to add customized features which are not in built in the Salesforce platform.
- Workflow rules, Validation Rules, Approval processes etc comprises the declarative method of applying business rules.
- The same logic achieved by using the above declarative methods can be programmed in the form of Apex Triggers, Apex Controllers and Apex Classes.
- These are written in the Apex language.
- The Visual force pages interact with the controller using the visual force components.
Looking for more information on MVC Architecture in Salesforce, leave us a message.
Take Five Consulting is a technology company, based in Virginia U.S., that specializes in the Mortgage Banking vertical especially LOS implementation and application development. Take Five Consulting creates and implement mortgage technology and software specifically for Mortgage Industry.