Thinking in Lightning

Developing a Lightning application is radically different from Visualforce development. The goal of this article is to give you the mindset that will help you effectively develop Lightning components.

Composition vs Inheritance

First things first. You probably are familiar with Object-Oriented-Programming and the concept of inheritance. When building a Lightning Application or Component, we need to use inheritance.

Build a Lightning Component

This is a general strategy for building a Lightning Component.

Start with a Design

Whether it’s a simple wire-frame on a napkin or a pixel perfect design, typing should not be your first step.

Jeff 1.png

 

Identify and Build the Sub-components

Once you know how your component should look. Break it into tinier sub-components. This will let you compose a bigger component with tiny building blocks. Note which components are grouped.

 Once you have tiny little components, you can focus on building each one of the individual components.

Once you have tiny little components, you can focus on building each one of the individual components.

Once you have tiny little components, you can focus on building each one of the individual components.

jeff 3.png

Assemble the UI with Sub-components

When you have your sub-components build, you can assemble them into your larger component.

Wire Up Attributes, Controllers, and Helpers

Lastly, once the markup and styling are complete. You can focus on adding functionality. At this point you can replace any static text place holders with attributes if they need to be changed. Additionally, now is the time to write any controllers that handle things like button actions.

Inpired by Thinking In React