SlideShare a Scribd company logo
1 of 39
Download to read offline
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

What's hot

ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction TutorialScott Lee
 
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...Aaron Saunders
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectJadson Santos
 
Extending Kubernetes with Operators
Extending Kubernetes with OperatorsExtending Kubernetes with Operators
Extending Kubernetes with Operatorspeychevi
 
Power Automate Techniques that "Saved Our Bacon"
Power Automate Techniques that "Saved Our Bacon"Power Automate Techniques that "Saved Our Bacon"
Power Automate Techniques that "Saved Our Bacon"Thomas Duff
 
Understanding router state in angular 7 passing data through angular router s...
Understanding router state in angular 7 passing data through angular router s...Understanding router state in angular 7 passing data through angular router s...
Understanding router state in angular 7 passing data through angular router s...Katy Slemon
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowYakov Fain
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kitVidhi Patel
 
Building a custom Oracle ADF Component
Building a custom Oracle ADF ComponentBuilding a custom Oracle ADF Component
Building a custom Oracle ADF ComponentWilfred van der Deijl
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 

What's hot (20)

ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Angular 5
Angular 5Angular 5
Angular 5
 
React Native Firebase
React Native FirebaseReact Native Firebase
React Native Firebase
 
Extending Kubernetes with Operators
Extending Kubernetes with OperatorsExtending Kubernetes with Operators
Extending Kubernetes with Operators
 
Power Automate Techniques that "Saved Our Bacon"
Power Automate Techniques that "Saved Our Bacon"Power Automate Techniques that "Saved Our Bacon"
Power Automate Techniques that "Saved Our Bacon"
 
Understanding router state in angular 7 passing data through angular router s...
Understanding router state in angular 7 passing data through angular router s...Understanding router state in angular 7 passing data through angular router s...
Understanding router state in angular 7 passing data through angular router s...
 
Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 
Controls
ControlsControls
Controls
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
 
Building a custom Oracle ADF Component
Building a custom Oracle ADF ComponentBuilding a custom Oracle ADF Component
Building a custom Oracle ADF Component
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 

Similar to Advanced designs for reusable lightning components

Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overviewrajdeep
 
Deep diving into building lightning components
Deep diving into building lightning componentsDeep diving into building lightning components
Deep diving into building lightning componentsCloud Analogy
 
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platformandyinthecloud
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsFlorian Weil
 
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Nidhi Sharma
 
React more than just components
React   more than just componentsReact   more than just components
React more than just componentsChen Feldman
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)Prashanth Shivakumar
 
Building a Lightning App with Angular Material Design
Building a Lightning App with Angular Material DesignBuilding a Lightning App with Angular Material Design
Building a Lightning App with Angular Material DesignSalesforce Developers
 
Leveraging Dynamic Interactions on Salesforce Lightning Pages
Leveraging Dynamic Interactions on Salesforce Lightning PagesLeveraging Dynamic Interactions on Salesforce Lightning Pages
Leveraging Dynamic Interactions on Salesforce Lightning PagesCodeScience
 
A Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptxA Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptxKadharBashaJ
 
Reactive web
Reactive webReactive web
Reactive webdega1999
 
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)Nuzhat Memon
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 PreviewMarrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 PreviewLucas Jellema
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Migrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIMigrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIGregor Zurowski
 

Similar to Advanced designs for reusable lightning components (20)

Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
 
Deep diving into building lightning components
Deep diving into building lightning componentsDeep diving into building lightning components
Deep diving into building lightning components
 
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, traps
 
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...
 
React more than just components
React   more than just componentsReact   more than just components
React more than just components
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)
 
Building a Lightning App with Angular Material Design
Building a Lightning App with Angular Material DesignBuilding a Lightning App with Angular Material Design
Building a Lightning App with Angular Material Design
 
Leveraging Dynamic Interactions on Salesforce Lightning Pages
Leveraging Dynamic Interactions on Salesforce Lightning PagesLeveraging Dynamic Interactions on Salesforce Lightning Pages
Leveraging Dynamic Interactions on Salesforce Lightning Pages
 
A Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptxA Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptx
 
Reactive web
Reactive webReactive web
Reactive web
 
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
Std 12 Computer Chapter 2 Cascading Style Sheet and Javascript (Part-2)
 
Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 PreviewMarrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
Marrying HTML5 and Angular to ADF - Oracle OpenWorld 2014 Preview
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Migrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIMigrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UI
 
Ddpz2613 topic9 java
Ddpz2613 topic9 javaDdpz2613 topic9 java
Ddpz2613 topic9 java
 
Adf component tech14
Adf component tech14Adf component tech14
Adf component tech14
 
Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...
Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...
Marrying together the worlds of ADF and HTML5 & AngularJS - Oracle OpenWorld ...
 

Recently uploaded

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

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