Activity Forums Salesforce® Discussions What is difference between vf page and lightning component in Salesforce?

  • What is difference between vf page and lightning component in Salesforce?

    Posted by Deepak on August 27, 2019 at 1:20 pm

    What is difference between vf page and lightning component in Salesforce?

    Saddam replied 5 years, 3 months ago 3 Members · 2 Replies
  • 2 Replies
  • Prachi

    Member
    August 28, 2019 at 4:26 am

    Hi Deepak,

    There are a lot of fundamental differences between Visualforce Page and Lightning Components:-

    Visualforce Page:
    1. Page-Centric Model.
    2. Most of the processing takes place on the server-side.
    3. Applications are divided into pages and each page is an independent entity.
    4. The server connects different Vf pages so that they can share data.
    5. Primarily for Desktop.
    6. Interactivity limited without javascript.

    Lightning Component :
    1. App-Centric Model.
    2. As server calls are expensive, we call the server methods only when it is absolutely necessary and rest of the manipulations are performed on client-side using Javascript.
    3. Applications are built with components and multiple components assembled together to form an app.
    4. Events, Attributes, and Methods can help communication between two Lightning components.
    5. Supports Desktop and Mobile both.
    6. Highly interactive and has javascript built right in.

    Thanks.

  • Saddam

    Member
    August 28, 2019 at 6:56 am

    Hi Deepak,

    Visualforce Page

    Visualforce components are page-centric
    Most of the work is done on the server.
    JavaScript buttons and links are supported
    There are three steps to add Lightning components to a Visualforce page:
    Add <apex:includeLightning/> at the beginning of your page.
    Create and reference a Lightning app that declares your component dependencies.
    Write a JavaScript function that creates the component on the page using $Lightning.createComponent()
    In Salesforce Classic, Visualforce “owns” the page, the request, the environment. Visualforce is the application container
    Primarily for Desktop
    Based on MVC framework
    My domain is not required
    Server sends the resulting HTML to the browser

    Lightning Components:

    Lightning Components are client-side centric
    It's on the client-side which makes them more dynamic and mobile-friendly.
    JavaScript buttons and links aren’t supported.
    Add an iframe to the Lightning Component and set the source url of the iframe to the Visualforce Page.
    In Lightning Experience, Visualforce runs inside an iframe that’s wrapped inside the larger Lightning Experience container.
    "Mobile First" concept of design.
    It is a component-based framework.
    My domain is required to use Lightning Components.
    The application/component bundle is sent to the client, then the browser generates the UI by loading the bundle using Javascript libraries.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos