Activity Forums Salesforce® Discussions Can anyone help me with Model, View and Controller concept in Salesforce?

  • Satyakam

    Member
    May 25, 2016 at 12:32 pm

    Salesforce MVC-

    We write SFDC visual force (VF pages). Each VF page is associated with a Controller and this controller may be a custom controller or a standard controller.Visualforce uses the model-view-controller (MVC) paradigm.

    Saleforce MVC pattern contains below three modules:

    1.Model
    2.View
    3.Controller

    Model:

    What schema and data does salesforce uses to represent the system completely. In salesforce, we can say that sObjects are the model as every entity in salesforce is mapped to some sObject.

    View:

    How the schema and data is represented. Visualforce is used to present the data to users.

    Controller:

    How the interface actions. Controllers are used to perform the actions whenever users interact with visual force.

  • shariq

    Member
    July 21, 2017 at 9:08 am

    Hi Himanshu,

    Model-View-Controller :-

    Model -

    The Model is simply the underlying database. In Visualforce, it’s the collection of Salesforce objects and fields that we’d represent and modify in our page.

    View -

    The View is the code that makes up our page’s UI. In our case, it’s all of our Visualforce, HTML, CSS, and Javascript code.

    Controller -

    The Controller is the middle layer between the model and the view. It’s the Apex code that interacts with the database according to the view’s needs.

  • Madison

    Member
    August 3, 2017 at 11:59 am

    Hello Himanshu,

    Here I will share MVC in SalesForce diagram which explains brief overview. Find below diagram

    SalesForce MVC

    For MVC detailed description please check this site TekSlate.com Hope you like it.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos