SlideShare a Scribd company logo
Advanced Designs for
Reusable Lightning
Components
Take your front-end development skills to the next level
tom.waud@westbrook.co.uk
@thomas_waud
Tom Waud
​Chief Technical Architect
https://github.com/AutomaTom/scheduler
Agenda
Introducing the Scheduler Component
Composition using Facets
Event Bubbling and dynamic creation of Event Handlers
Dynamic creation of Lightning Components
Object Oriented Design with Lightning Components
1
2
3
4
5
Introducing the Scheduler Component
● Add a new job
● Schedule a job
● Abort a scheduled job
● Delete a job
● Edit an existing job
● Provide a UI to assist
in the creation of the
cron expression
Requirements
Cron Expressions
“The origin of the name cron is from the Greek word for time, χρόνος”
Format
Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
Examples
Demo
Composition using Facets
“The act of combining parts or elements to form a whole”
Composition Using Facets
● Contains one or more
Tabs
● Maintain styling to
indicate Tab focus
● Fire TabFocus and
TabBlur events
● Allow the parent
component to specify
the contents of the Tab
panel
Requirements for a Tab List component
Composition Using Facets
TabList Component A facet is any attribute of type
Aura.Component[]
Composition Using Facets
Tab Component
Composition Using Facets
EditScheduledJob Component
Event Bubbling & Dynamic
Creation of Event Handlers
Event Bubbling and dynamic creation of Event Handlers
Application Events
“Application events follow a traditional publish-subscribe model. An application
event is fired from an instance of a component. All components that provide a
handler for the event are notified.”
Component Events
“A component event is fired from an instance of a component. A component
event can be handled by the component that fired the event or by a component
in the containment hierarchy that receives the bubbled event.”
Event Bubbling and dynamic creation of Event Handlers
Click
Event Bubbling and dynamic creation of Event Handlers
c:TabList c:Tab
Click
c:Tab
Event Bubbling and dynamic creation of Event Handlers
Propagating Component Events to All Container Components - Winter 17
Dynamic creation of
Lightning Components
“Refers to the creation of components at the moment they are
needed rather than in advance”
Dynamic creation of Lightning Components
● Contains one or more
Tabs
● Maintain styling to
indicate Tab focus
● Fire TabFocus and
TabBlur events
● Allow the parent
component to specify
the contents of the Tab
panel
Requirements for a Tab List component
Dynamic creation of Lightning Components
Dynamic creation of Lightning Components
EditScheduledJob Component
Dynamic creation of Lightning Components
EditScheduledJob Component
Dynamic creation of Lightning Components
EditScheduledJob Component
Dynamic creation of Lightning Components
EditScheduledJob Component
Dynamic creation of Lightning Components
aura:dependency
Dynamic creation of Lightning Components
“When a component event is
fired, the component that fired
the event can handle it.”
“The event then bubbles up
and can be handled by a
component in the
containment hierarchy.”
Component Events
Child
Parent
Fixed in Winter 17
Workaround in Summer 16
Object Oriented Design with
Lightning Components
“The framework provides the basic constructs of inheritance and
encapsulation from object-oriented programming and applies them
to presentation layer development”
Object Oriented Design with Lightning Components
Encapsulation
“The process of hiding a component’s attributes and methods from consumers.”
Inheritance
“A mechanism for code reuse whereby a component author can create a sub
component that inherits the attributes and methods of a super component”
Object Oriented Design with Lightning Components
● Global
Available in all namespaces.
● Public
Available within the same
namespace. This is the default
access value.
● Private
Available within the component,
app, interface, or event and can’t
be referenced externally.
Encapsulation
Object Oriented Design with Lightning Components
Inheritance
Object Oriented Design with Lightning Components
Inheritance
Object Oriented Design with Lightning Components
Inheritance
Object Oriented Design with Lightning Components
Inheritance
Object Oriented Design with Lightning Components
Inheritance
Object Oriented Design with Lightning Components
● Attributes
● Events
● Helper Methods
● Controller Methods
(Not recommended)
● DOM
Inheritance
Helper methods on a super component are not currently accessible from the
sub component without a workaround (Summer 16)
You can’t access a private attribute from a sub-component that extends the
component containing the private attribute.
Object Oriented Design with Lightning Components
● Attributes
● Events
● Helper Methods
● Controller Methods
(Not recommended)
● DOM
Inheritance
Object Oriented Design with Lightning Components
● Attributes
● Events
● Helper Methods
● Controller Methods
(Not recommended)
● DOM
Inheritance
Helper methods on a super component are not currently accessible from the
sub component without a workaround (Summer 16)
Object Oriented Design with Lightning Components
● Attributes
● Events
● Helper Methods
● Controller Methods
(Not recommended)
● DOM
Inheritance
You can’t access the super-component DOM from a sub-component that
extends it.
What We Learned
Composition using Facets
Event Bubbling and dynamic creation of Event Handlers
Dynamic creation of Lightning Components
Object Oriented Design with Lightning Components
How Winter 17 is making Lightning Component Development even easier
1
2
3
4
5
Resources
Github:
https://github.com/AutomaTom/scheduler
Winter 17 Release Notes:
https://releasenotes.docs.salesforce.com/en-us/winter17/release-notes/salesforce_release_notes.htm
Trailhead:
https://trailhead.salesforce.com/
Lightning Component Developer Guide:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/
1
2
3
4
Thank Y u

More Related Content

PPTX
Mastering the Lightning Framework - Part 2
PDF
Salesforce Lightning Tips & Tricks
PDF
Salesforce Lightning Components Workshop
PPTX
Lightning Components Workshop
PDF
Angular 4 for Java Developers
PPT
Web controls
PDF
Get rid of controllers in angular 1.5.x start using component directives
PDF
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Mastering the Lightning Framework - Part 2
Salesforce Lightning Tips & Tricks
Salesforce Lightning Components Workshop
Lightning Components Workshop
Angular 4 for Java Developers
Web controls
Get rid of controllers in angular 1.5.x start using component directives
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...

What's hot (20)

PPTX
ASP.NET Page Life Cycle
PPTX
Introduction to Angular JS
PPTX
Angular 4 Introduction Tutorial
PDF
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
PPTX
Introduction to angular with a simple but complete project
PPTX
PDF
React Native Firebase
PDF
Extending Kubernetes with Operators
PDF
Power Automate Techniques that "Saved Our Bacon"
PDF
Understanding router state in angular 7 passing data through angular router s...
PPTX
PPTX
Controls
PPTX
Advanced SharePoint Web Part Development
PDF
Integrating consumers IoT devices into Business Workflow
PPTX
Ajax control tool kit
PDF
Building a custom Oracle ADF Component
ZIP
ASP.Net Presentation Part1
PPT
Asp.Net Ajax Component Development
ASP.NET Page Life Cycle
Introduction to Angular JS
Angular 4 Introduction Tutorial
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Introduction to angular with a simple but complete project
React Native Firebase
Extending Kubernetes with Operators
Power Automate Techniques that "Saved Our Bacon"
Understanding router state in angular 7 passing data through angular router s...
Controls
Advanced SharePoint Web Part Development
Integrating consumers IoT devices into Business Workflow
Ajax control tool kit
Building a custom Oracle ADF Component
ASP.Net Presentation Part1
Asp.Net Ajax Component Development
Ad

Similar to Advanced designs for reusable lightning components (20)

PDF
Aura Framework Overview
PDF
Deep diving into building lightning components
PPTX
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
PDF
Moving from AS3 to Flex - advantages, hazards, traps
PPTX
Lightning web components - Introduction, component Lifecycle, Events, decorat...
PPTX
React more than just components
PPS
WPF (Windows Presentation Foundation Unit 01)
PDF
Building a Lightning App with Angular Material Design
PDF
Leveraging Dynamic Interactions on Salesforce Lightning Pages
PPTX
A Review on LWC Events for communication.pptx
PPTX
Mastering the Lightning Framework - Part 2 - JF Paradis.pptx
PDF
Reactive web
PPTX
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
PDF
Javascript projects Course
PPTX
20180518 QNAP Seminar - Introduction to React Native
PPTX
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
PPTX
O365 Developer Bootcamp NJ 2018 - Material
PDF
Migrating a Large AEM Project to Touch UI
PPT
Ddpz2613 topic9 java
PDF
Adf component tech14
Aura Framework Overview
Deep diving into building lightning components
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Moving from AS3 to Flex - advantages, hazards, traps
Lightning web components - Introduction, component Lifecycle, Events, decorat...
React more than just components
WPF (Windows Presentation Foundation Unit 01)
Building a Lightning App with Angular Material Design
Leveraging Dynamic Interactions on Salesforce Lightning Pages
A Review on LWC Events for communication.pptx
Mastering the Lightning Framework - Part 2 - JF Paradis.pptx
Reactive web
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
Javascript projects Course
20180518 QNAP Seminar - Introduction to React Native
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
O365 Developer Bootcamp NJ 2018 - Material
Migrating a Large AEM Project to Touch UI
Ddpz2613 topic9 java
Adf component tech14
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
sap open course for s4hana steps from ECC to s4
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Network Security Unit 5.pdf for BCA BBA.
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Advanced designs for reusable lightning components

  • 1. Advanced Designs for Reusable Lightning Components Take your front-end development skills to the next level tom.waud@westbrook.co.uk @thomas_waud Tom Waud ​Chief Technical Architect https://github.com/AutomaTom/scheduler
  • 2. Agenda Introducing the Scheduler Component Composition using Facets Event Bubbling and dynamic creation of Event Handlers Dynamic creation of Lightning Components Object Oriented Design with Lightning Components 1 2 3 4 5
  • 3. Introducing the Scheduler Component ● Add a new job ● Schedule a job ● Abort a scheduled job ● Delete a job ● Edit an existing job ● Provide a UI to assist in the creation of the cron expression Requirements
  • 4. Cron Expressions “The origin of the name cron is from the Greek word for time, χρόνος” Format Seconds Minutes Hours Day_of_month Month Day_of_week optional_year Examples
  • 6. Composition using Facets “The act of combining parts or elements to form a whole”
  • 7. Composition Using Facets ● Contains one or more Tabs ● Maintain styling to indicate Tab focus ● Fire TabFocus and TabBlur events ● Allow the parent component to specify the contents of the Tab panel Requirements for a Tab List component
  • 8. Composition Using Facets TabList Component A facet is any attribute of type Aura.Component[]
  • 11. Event Bubbling & Dynamic Creation of Event Handlers
  • 12. Event Bubbling and dynamic creation of Event Handlers Application Events “Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.” Component Events “A component event is fired from an instance of a component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the bubbled event.”
  • 13. Event Bubbling and dynamic creation of Event Handlers Click
  • 14. Event Bubbling and dynamic creation of Event Handlers c:TabList c:Tab Click c:Tab
  • 15. Event Bubbling and dynamic creation of Event Handlers Propagating Component Events to All Container Components - Winter 17
  • 16. Dynamic creation of Lightning Components “Refers to the creation of components at the moment they are needed rather than in advance”
  • 17. Dynamic creation of Lightning Components ● Contains one or more Tabs ● Maintain styling to indicate Tab focus ● Fire TabFocus and TabBlur events ● Allow the parent component to specify the contents of the Tab panel Requirements for a Tab List component
  • 18. Dynamic creation of Lightning Components
  • 19. Dynamic creation of Lightning Components EditScheduledJob Component
  • 20. Dynamic creation of Lightning Components EditScheduledJob Component
  • 21. Dynamic creation of Lightning Components EditScheduledJob Component
  • 22. Dynamic creation of Lightning Components EditScheduledJob Component
  • 23. Dynamic creation of Lightning Components aura:dependency
  • 24. Dynamic creation of Lightning Components “When a component event is fired, the component that fired the event can handle it.” “The event then bubbles up and can be handled by a component in the containment hierarchy.” Component Events Child Parent Fixed in Winter 17 Workaround in Summer 16
  • 25. Object Oriented Design with Lightning Components “The framework provides the basic constructs of inheritance and encapsulation from object-oriented programming and applies them to presentation layer development”
  • 26. Object Oriented Design with Lightning Components Encapsulation “The process of hiding a component’s attributes and methods from consumers.” Inheritance “A mechanism for code reuse whereby a component author can create a sub component that inherits the attributes and methods of a super component”
  • 27. Object Oriented Design with Lightning Components ● Global Available in all namespaces. ● Public Available within the same namespace. This is the default access value. ● Private Available within the component, app, interface, or event and can’t be referenced externally. Encapsulation
  • 28. Object Oriented Design with Lightning Components Inheritance
  • 29. Object Oriented Design with Lightning Components Inheritance
  • 30. Object Oriented Design with Lightning Components Inheritance
  • 31. Object Oriented Design with Lightning Components Inheritance
  • 32. Object Oriented Design with Lightning Components Inheritance
  • 33. Object Oriented Design with Lightning Components ● Attributes ● Events ● Helper Methods ● Controller Methods (Not recommended) ● DOM Inheritance Helper methods on a super component are not currently accessible from the sub component without a workaround (Summer 16) You can’t access a private attribute from a sub-component that extends the component containing the private attribute.
  • 34. Object Oriented Design with Lightning Components ● Attributes ● Events ● Helper Methods ● Controller Methods (Not recommended) ● DOM Inheritance
  • 35. Object Oriented Design with Lightning Components ● Attributes ● Events ● Helper Methods ● Controller Methods (Not recommended) ● DOM Inheritance Helper methods on a super component are not currently accessible from the sub component without a workaround (Summer 16)
  • 36. Object Oriented Design with Lightning Components ● Attributes ● Events ● Helper Methods ● Controller Methods (Not recommended) ● DOM Inheritance You can’t access the super-component DOM from a sub-component that extends it.
  • 37. What We Learned Composition using Facets Event Bubbling and dynamic creation of Event Handlers Dynamic creation of Lightning Components Object Oriented Design with Lightning Components How Winter 17 is making Lightning Component Development even easier 1 2 3 4 5
  • 38. Resources Github: https://github.com/AutomaTom/scheduler Winter 17 Release Notes: https://releasenotes.docs.salesforce.com/en-us/winter17/release-notes/salesforce_release_notes.htm Trailhead: https://trailhead.salesforce.com/ Lightning Component Developer Guide: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ 1 2 3 4