Visualforce: The Visualforce framework provides a robust set of tags that are resolved at the server-side and that work alongside standard or custom controllers to make database and other operations simple to implement. This is a page-centric web application model. It’s great for basic functionality, but it’s challenging to deliver the new, more dynamic experience that users expect. Fundamentally, this is because it relies on the server to generate a new page every time you interact with the application.
A Quick Peek How These Two — Visualforce and Lightning work actually —
|Server-Side: User requests a page .The server executes the page’s underlying code and sends the resulting HTML to the browser .The browser displays the HTML when the user interacts with the page, return to step one.
|Tried and true model
|Enables highly interactive and immersive user experiences
|It has not a Two-way binding, you need to wait to see update until the whole page get updated fromthe server at the end.
|By default, it has Two-way binding, once something gets updated it will show up immediately on the UI.
|Easy to implement for greater productivity
|Aligns with Salesforce user interface strategy
|Naturally splits large applications into small, manageable pages
|Built on metadata from the foundation, providing an integrated developer experience
|Has built-in metadata integration
|The Developer Console supports Lightning components, so there’s an integrated developerexperience
|Higher learning curve compared to Visualforce
|Higher complexity than Visualforce–you’re building an application, not a page
|Since Lightning components are new, there are still some features that aren’t supported
|There are a limited number of out-of-the-box components
Use Cases of Lightning and Visualforce —
- Developing for Salesforce1 Mobile Application Lightning should be used as Visualforce characteristics, especially the page-centric orientation, can be a poor match for mobile apps with limited, high-latency network connections and limited compute resources. Lightning components, by contrast, was designed specifically to handle this context.
- Enabling non-developers to build apps by assembling standard or custom components Lightning App Builder should be used and Lightning components for custom components. Use Visualforce if the required components aren’t yet available.
- For adding user interface element for example,say someone wants to add a tab to a record home. This task is a simple drag-and-drop in Lightning App Builder.
- Community for Customer: Building a Community for Customers one should use Community Builder to create a Lightning-based community site leveraging Lightning components.
- If you are committed to invest in latest technology you should start using Lightning Components.
- If you are starting a brand-new project you should use Lightning Components. If you’re not familiar with them, there’s no better time than now to learn!
- For building a page-centric experience with limited Client-Side logic use Visualforce.
- Community for Partner: Building a community for partners continue using Visualforce in Salesforce Classic. Explore using Lightning components with Lightning components for Visualforce.
- Exposing a Public-Facing Unauthenticated Website continue using Visualforce. Lightning components don’t support an anonymous(unauthenticated) user context yet.
- Rendering pages as PDF in a application use Visualforce. Lightning components don’t support rendering as PDF output yet.
- Adding to an existing project with lots of Visualforce Pages continue to use Visualforce. Consider moving to Lightning components using Lightning components for Visualforce.
Other Decision-Making points:
What is the business need?
This is what one should be focused on from the start. In my experience, most customers won’t care what technology you use to satisfy their requirements. What they won’t be happy about is you expecting them to compromise their experience so that you don’t have to compromise your technical integrity.The purpose of the exercise is not for you to demonstrate your mastery of the most complex combination of languages and libraries, it is to deliver the experience the customer wants with maximum ROI , and ease of maintenance going forward.
Do you need code at all?
This should always be the first question that you ask yourself when considering custom functionality on the Salesforce platform. If you can find a declarative solution, potentially even one that sacrifices some ease of use for ease of maintenance, always go that route.You can do most things with either of them .
Want to use the Salesforce Lightning Design System?
Works fine with both (even with standard Visualforce components, with a little jiggery pokery).
Want to keep the business logic on the client side?
That means you either need Lightning Components or Visualforce remote methods.
No problem, you either include it via a standard Visualforce component or a standard Lightning Component.You can’t do some things with one of them .Lightning Components don’t have a built-in unit test framework. Visualforce embedded in Lightning Experience record pages won’t be sized correctly.If you have hard requirements that only one technology supports, then you are golden and the decision is easy. However, it’s more likely that you’ll have hard requirements that only a combination of both technologies supports. In which case, you must continue evaluating the pros and cons.
What have you used in the past?
What is the existing skill set?
What is the budget?
If your customer has presented you with a tight budget, then there probably isn’t money available to skill up existing staff,unless your employer is prepared to pay for that themselves. Even if the money is there, an aggressive timescale (when are they ever not?) means that finding the time to learn will be a challenge. A combination of both means that you should look to play to your strengths rather than take a punt on the unknown.
What is the complexity?
Words for the Salesforce Developers for Lightning Component Development–
- Should have good knowledge of HTML and CSS. Lightning core is the UI. Lightning has a very responsive and interactive UI. One should have a very good knowledge to keep the core of Lightning if some complex requirement comes up.
- Should have a very creative mind. Lightning is all about creativity. The more you are creative the more you bring out of Lightning.
There is no right answer. At least not yet. Once the Lightning Component framework achieves the same richness as Visualforce in terms of standard components and declarative controller functionality, the decision will be more straightforward.As of now, there’s nothing wrong with building in Visualforce, even if it feels like Lightning components are the future. There are millions of Visualforce pages out there. Salesforce have put a lot of effort into making sure that these work correctly in the Lightning Experience,and Visualforce isn’t going away any time soon, so don’t feel guilty for not for asking it.