Lightning

Salesforce Lightning Components

bryanfrye Blog

The Lightning Component Framework is Salesforce’s new framework for building dynamic single-page user interfaces that will run on phones, tablets, and the desktop.  The Salesforce1 Mobile app was developed with Lightning Components and Salesforce is now opening up that framework to developers and administrators to build their own components and applications that can be used in the Salesforce1 Mobile app.

This is exciting because it allows companies to take control of how they use SalesForce1 on mobile devices.  You’re no longer limited by the built-in functionality of the SalesForce1 app because you can extend it with custom functionality built for exactly what your mobile users need to accomplish.  Streamlined interfaces made to fit business needs can increase productivity and make it possible to handle things on the go that would have required being at a computer before.  It’s also built directly in Salesforce so there’s no need to deal with the differing development kits and languages needed for supporting multiple mobile platforms.

Salesforce provides a few built-in components and new ones can be uploaded to the AppExchange for distribution.  Applications can use combinations of built-in, AppExchange, and in-house developed components to accomplish their functionality.  Building new components involves writing Lightning-specific JavaScript and Aura-enabled Apex in the Developer Console.

Lightning Components are based on an existing Open Source framework called Aura.  Some components and features from the Aura framework are available now in Lightning with more to be released.  Lightning Components were released as beta in Winter ’15 and are available for developers to build components in the framework now.  A drag and drop App Builder is expected to be released in Spring ’15 to allow administrators to create Lightning applications by combining and configuring Lightning Components.

This framework gives more control over complicated dynamic behavior in the interface than has been available in Salesforce previously but it also has increased complexity.  Page layouts are the simplest UI control method available, followed by additional complexity and control available with VisualForce pages.  There are situations where standard VisualForce does not offer enough control for complex interfaces and some sort of additional JavaScript must be used.  Lightning components offer a technical solution completely inside Salesforce that allows that higher level of control, but the code is significantly more complex.

Some of the additional interesting features of Salesforce Lightning include:

·         A custom event model for communicating between components

·         Expression syntax similar to that used in VisualForce

·         Client-side controller functions written in JavaScript attached to interface actions

·         Server-side controller methods written in Apex and called from JavaScript