SlideShare a Scribd company logo

Foundational Design Patterns for Multi-Purpose Applications

This document discusses foundational design patterns for multi-purpose applications. It covers topics like coupling, cohesion, and moving beyond using a single while loop. Functional global variables and queued message handlers are introduced as design patterns to enable communication between independent processes. The document provides examples of how these patterns can be used to decompose an application into independent processes to improve scalability, testability, and maintainability.

1 of 45
Download to read offline
ni.com
Foundational Design Patterns for
Multi-Purpose Applications
Ching-Hwa Yu
Software Group Leader | Certified LabVIEW Architect
Solution Sources Programming, Inc.
2ni.com
Topics
• Creating scalable applications
• Coupling
• Cohesion
• Moving beyond one loop
• Design patterns
• Communication mechanisms
• Functional global variables [DEMO]
• Queued message handlers [DEMO]
3ni.com
When Most
Consider Advanced
Architectures
When You Should Consider Advanced
Architectures
DefiningAdvancedApplications & LabVIEWAbility
Ability
3-Icon
Apps
State
Machines
Multi-Process
Apps
Multi-Target
Apps
LearningEffort
4ni.com
Master Key Design Patterns…
…and Understand Their Limitations
Ability
3-Icon
Apps
State
Machines
Multi-Process
Apps
Multi-Target
Apps
LearningEffort
Master the FGV
and the QMH
5ni.com
While Loop
Acquire Analyze Log Present
10ms 50ms 250ms 20ms
Doing Everything in One Loop Can Cause Problems
• One cycle takes at least 330 ms
• User interface can only be updated every 330 ms
• If the acquisition reads from a buffer, it may fill up
6ni.com
While Loop
Acquire Analyze
Log
Present10ms 50ms
250ms
20ms
Doing Everything in One Loop Can Cause Problems
• One cycle still takes at least 310 ms
• These are examples of high coupling

Recommended

Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classificationgopal10scs185
 
Human Computer Interaction Chapter 3 HCI in the Software Process and Design ...
Human Computer Interaction Chapter 3 HCI in the Software Process and  Design ...Human Computer Interaction Chapter 3 HCI in the Software Process and  Design ...
Human Computer Interaction Chapter 3 HCI in the Software Process and Design ...VijiPriya Jeyamani
 
HCI 3e - Ch 13: Socio-organizational issues and stakeholder requirements
HCI 3e - Ch 13:  Socio-organizational issues and stakeholder requirementsHCI 3e - Ch 13:  Socio-organizational issues and stakeholder requirements
HCI 3e - Ch 13: Socio-organizational issues and stakeholder requirementsAlan Dix
 
Scalable community detection with the louvain algorithm
Scalable community detection with the louvain algorithmScalable community detection with the louvain algorithm
Scalable community detection with the louvain algorithmNavid Sedighpour
 
Social Media Mining - Chapter 5 (Data Mining Essentials)
Social Media Mining - Chapter 5 (Data Mining Essentials)Social Media Mining - Chapter 5 (Data Mining Essentials)
Social Media Mining - Chapter 5 (Data Mining Essentials)SocialMediaMining
 

More Related Content

What's hot

Types of Big Data.pptx
Types of Big Data.pptxTypes of Big Data.pptx
Types of Big Data.pptxvarun453331
 
Back face detection
Back face detectionBack face detection
Back face detectionPooja Dixit
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithmMani Kanth
 
Unit 4 designing classes
Unit 4  designing classesUnit 4  designing classes
Unit 4 designing classesgopal10scs185
 
Bài 1 Tổng quan về MS Access - Giáo trình FPT
Bài 1 Tổng quan về MS Access - Giáo trình FPTBài 1 Tổng quan về MS Access - Giáo trình FPT
Bài 1 Tổng quan về MS Access - Giáo trình FPTMasterCode.vn
 
Human Computer Interaction
Human Computer InteractionHuman Computer Interaction
Human Computer InteractionBHAKTI PATIL
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagramRamakant Soni
 
HCI 3e - Ch 12: Cognitive models
HCI 3e - Ch 12:  Cognitive modelsHCI 3e - Ch 12:  Cognitive models
HCI 3e - Ch 12: Cognitive modelsAlan Dix
 
Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1gopal10scs185
 
Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)
Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)
Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)MasterCode.vn
 
Machine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & OpportunitiesMachine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & OpportunitiesCodePolitan
 
hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmrajivagarwal23dei
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML DiagramsManish Kumar
 

What's hot (20)

Types of Big Data.pptx
Types of Big Data.pptxTypes of Big Data.pptx
Types of Big Data.pptx
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
 
Unit 4 designing classes
Unit 4  designing classesUnit 4  designing classes
Unit 4 designing classes
 
Intelligent web applications
Intelligent web applicationsIntelligent web applications
Intelligent web applications
 
Frame buffer
Frame bufferFrame buffer
Frame buffer
 
Web data mining
Web data miningWeb data mining
Web data mining
 
Bài 1 Tổng quan về MS Access - Giáo trình FPT
Bài 1 Tổng quan về MS Access - Giáo trình FPTBài 1 Tổng quan về MS Access - Giáo trình FPT
Bài 1 Tổng quan về MS Access - Giáo trình FPT
 
Human Computer Interaction
Human Computer InteractionHuman Computer Interaction
Human Computer Interaction
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
HCI 3e - Ch 12: Cognitive models
HCI 3e - Ch 12:  Cognitive modelsHCI 3e - Ch 12:  Cognitive models
HCI 3e - Ch 12: Cognitive models
 
Ooad
OoadOoad
Ooad
 
Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1Unt 3 attributes, methods, relationships-1
Unt 3 attributes, methods, relationships-1
 
Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)
Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)
Hệ thống thông tin quản lý - Bài 6 Phát triển hệ thống thông tin (phần 1)
 
Halftoning in Computer Graphics
Halftoning  in Computer GraphicsHalftoning  in Computer Graphics
Halftoning in Computer Graphics
 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
 
Machine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & OpportunitiesMachine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & Opportunities
 
hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithm
 
7 ooad
7 ooad7 ooad
7 ooad
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 

Viewers also liked

NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...
NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...
NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...JKI
 
Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...
Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...
Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...JKI
 
CLA Summit 2013: Connecting LabVIEW to Everything Else
CLA Summit 2013: Connecting LabVIEW to Everything ElseCLA Summit 2013: Connecting LabVIEW to Everything Else
CLA Summit 2013: Connecting LabVIEW to Everything ElseJKI
 
NIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW Developer
NIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW DeveloperNIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW Developer
NIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW DeveloperJKI
 
NIWeek 2011: Put the LabVIEW Community to Work for You
NIWeek 2011: Put the LabVIEW Community to Work for YouNIWeek 2011: Put the LabVIEW Community to Work for You
NIWeek 2011: Put the LabVIEW Community to Work for YouJKI
 
LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015Jeffrey Habets
 
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW Developer
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW DeveloperNIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW Developer
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW DeveloperJKI
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to AkkaPiotr Trzpil
 
Model Predictive Control Implementation with LabVIEW
Model Predictive Control Implementation with LabVIEWModel Predictive Control Implementation with LabVIEW
Model Predictive Control Implementation with LabVIEWyurongwang1
 
SIMULATION OF TEMPERATURE SENSOR USING LABVIEW
SIMULATION OF TEMPERATURE SENSOR USING LABVIEWSIMULATION OF TEMPERATURE SENSOR USING LABVIEW
SIMULATION OF TEMPERATURE SENSOR USING LABVIEWPooja Shukla
 
Real time Vital Signs Monitorong Using NI LabVIEW
Real time Vital Signs Monitorong Using NI LabVIEWReal time Vital Signs Monitorong Using NI LabVIEW
Real time Vital Signs Monitorong Using NI LabVIEWTalha Patel
 

Viewers also liked (15)

NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...
NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...
NIWeek 2011: Beyond State Machines / Building Modular Applications in LabVIEW...
 
Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...
Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...
Beyond State Machines: Building Modular Applications in LabVIEW Using Public ...
 
CLA Summit 2013: Connecting LabVIEW to Everything Else
CLA Summit 2013: Connecting LabVIEW to Everything ElseCLA Summit 2013: Connecting LabVIEW to Everything Else
CLA Summit 2013: Connecting LabVIEW to Everything Else
 
NIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW Developer
NIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW DeveloperNIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW Developer
NIWeek 2011: Five Clever Debugging Techniques for Every LabVIEW Developer
 
Jki Introduction 2010
Jki   Introduction   2010Jki   Introduction   2010
Jki Introduction 2010
 
NIWeek 2011: Put the LabVIEW Community to Work for You
NIWeek 2011: Put the LabVIEW Community to Work for YouNIWeek 2011: Put the LabVIEW Community to Work for You
NIWeek 2011: Put the LabVIEW Community to Work for You
 
LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015
 
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW Developer
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW DeveloperNIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW Developer
NIWeek 2012: Secret Sauce / Tools to Make You a Better LabVIEW Developer
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
 
LabView Workshop
LabView WorkshopLabView Workshop
LabView Workshop
 
REAL TIME VITAL SIGN MONITORING USING NI LABVIEW
REAL TIME VITAL SIGN MONITORING USING NI LABVIEWREAL TIME VITAL SIGN MONITORING USING NI LABVIEW
REAL TIME VITAL SIGN MONITORING USING NI LABVIEW
 
Model Predictive Control Implementation with LabVIEW
Model Predictive Control Implementation with LabVIEWModel Predictive Control Implementation with LabVIEW
Model Predictive Control Implementation with LabVIEW
 
SIMULATION OF TEMPERATURE SENSOR USING LABVIEW
SIMULATION OF TEMPERATURE SENSOR USING LABVIEWSIMULATION OF TEMPERATURE SENSOR USING LABVIEW
SIMULATION OF TEMPERATURE SENSOR USING LABVIEW
 
Real time Vital Signs Monitorong Using NI LabVIEW
Real time Vital Signs Monitorong Using NI LabVIEWReal time Vital Signs Monitorong Using NI LabVIEW
Real time Vital Signs Monitorong Using NI LabVIEW
 
PPT - Powerful Presentation Techniques
PPT - Powerful Presentation TechniquesPPT - Powerful Presentation Techniques
PPT - Powerful Presentation Techniques
 

Similar to Foundational Design Patterns for Multi-Purpose Applications

Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Design World
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...
MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...
MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...sameh samir
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture corehard_by
 
Multi Layer Monitoring V1
Multi Layer Monitoring V1Multi Layer Monitoring V1
Multi Layer Monitoring V1Lahav Savir
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodologylaeshin park
 
oneM2M - Release 1 Primer
oneM2M - Release 1 PrimeroneM2M - Release 1 Primer
oneM2M - Release 1 PrimeroneM2M
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0Matt Lucas
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6Sravanthi N
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsInductive Automation
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsInductive Automation
 

Similar to Foundational Design Patterns for Multi-Purpose Applications (20)

Microservices.pdf
Microservices.pdfMicroservices.pdf
Microservices.pdf
 
Introduction
IntroductionIntroduction
Introduction
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...
MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...
MSF: Sync your Data On-Premises And To The Cloud - dotNetwork Gathering, Oct ...
 
Deploying at will - SEI
 Deploying at will - SEI Deploying at will - SEI
Deploying at will - SEI
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Choosing the right parallel compute architecture
Choosing the right parallel compute architecture Choosing the right parallel compute architecture
Choosing the right parallel compute architecture
 
Multi Layer Monitoring V1
Multi Layer Monitoring V1Multi Layer Monitoring V1
Multi Layer Monitoring V1
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
 
oneM2M - Release 1 Primer
oneM2M - Release 1 PrimeroneM2M - Release 1 Primer
oneM2M - Release 1 Primer
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise Solutions
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise Solutions
 

Recently uploaded

Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfMostafa Higazy
 
TrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI InnovationsTrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI InnovationsTrustArc
 
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfQ4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfTejal81
 
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptxGraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptxNeo4j
 
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024BookNet Canada
 
Geospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & EsriGeospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & EsriSafe Software
 
PrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5CompanyPrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5CompanyMustafa Kuğu
 
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlueVM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlueShapeBlue
 
Revolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, MonzoRevolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, MonzoProduct School
 
New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024ThousandEyes
 
AMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarAMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarThousandEyes
 
How to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanHow to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanDatabarracks
 
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...Chris Bingham
 
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHubHow We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHubShapeBlue
 
How AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxHow AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxInfosec
 
Large Language Models and Applications in Healthcare
Large Language Models and Applications in HealthcareLarge Language Models and Applications in Healthcare
Large Language Models and Applications in HealthcareAsma Ben Abacha
 
iOncologi_Pitch Deck_2024 slide show for hostinger
iOncologi_Pitch Deck_2024 slide show for hostingeriOncologi_Pitch Deck_2024 slide show for hostinger
iOncologi_Pitch Deck_2024 slide show for hostingerssuser9354ce
 
ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...
ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...
ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...Neo4j
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, TripadvisorProduct School
 
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...SearchNorwich
 

Recently uploaded (20)

Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdf
 
TrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI InnovationsTrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI Innovations
 
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfQ4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
 
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptxGraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
 
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
 
Geospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & EsriGeospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & Esri
 
PrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5CompanyPrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5Company
 
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlueVM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
VM Migration from VMware to CloudStack and KVM – Suresh Anaparti, ShapeBlue
 
Revolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, MonzoRevolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
Revolutionizing The Banking Industry: The Monzo Way by CPO, Monzo
 
New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024
 
AMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarAMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes Webinar
 
How to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanHow to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response Plan
 
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
 
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHubHow We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
How We Grew Up with CloudStack and its Journey – Dilip Singh, DataHub
 
How AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxHow AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptx
 
Large Language Models and Applications in Healthcare
Large Language Models and Applications in HealthcareLarge Language Models and Applications in Healthcare
Large Language Models and Applications in Healthcare
 
iOncologi_Pitch Deck_2024 slide show for hostinger
iOncologi_Pitch Deck_2024 slide show for hostingeriOncologi_Pitch Deck_2024 slide show for hostinger
iOncologi_Pitch Deck_2024 slide show for hostinger
 
ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...
ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...
ASTRAZENECA. Knowledge Graphs Powering a Fast-moving Global Life Sciences Org...
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
 
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
 

Foundational Design Patterns for Multi-Purpose Applications

  • 1. ni.com Foundational Design Patterns for Multi-Purpose Applications Ching-Hwa Yu Software Group Leader | Certified LabVIEW Architect Solution Sources Programming, Inc.
  • 2. 2ni.com Topics • Creating scalable applications • Coupling • Cohesion • Moving beyond one loop • Design patterns • Communication mechanisms • Functional global variables [DEMO] • Queued message handlers [DEMO]
  • 3. 3ni.com When Most Consider Advanced Architectures When You Should Consider Advanced Architectures DefiningAdvancedApplications & LabVIEWAbility Ability 3-Icon Apps State Machines Multi-Process Apps Multi-Target Apps LearningEffort
  • 4. 4ni.com Master Key Design Patterns… …and Understand Their Limitations Ability 3-Icon Apps State Machines Multi-Process Apps Multi-Target Apps LearningEffort Master the FGV and the QMH
  • 5. 5ni.com While Loop Acquire Analyze Log Present 10ms 50ms 250ms 20ms Doing Everything in One Loop Can Cause Problems • One cycle takes at least 330 ms • User interface can only be updated every 330 ms • If the acquisition reads from a buffer, it may fill up
  • 6. 6ni.com While Loop Acquire Analyze Log Present10ms 50ms 250ms 20ms Doing Everything in One Loop Can Cause Problems • One cycle still takes at least 310 ms • These are examples of high coupling
  • 7. 7ni.com User Interface Event Handler DAQ Acquisition DAQ Execution: The user interface cannot respond to other input while acquiring data Development: Modifying one process requires modifying the other Extensibility: How do you add a data logging process? Maintenance: Can you test one piece of an application without testing its entirety? Why is Coupling Bad?
  • 8. 8ni.com Coupling is OftenAccidental: Case Study Initial Scope • Demonstrate: • Data Acquisition • CAN Synchronization • Selected Architecture: • State Machine Final [Expanded] Scope • Demonstrate: • Data Acquisition • CAN Synchronization • IMAQ Acquisition • TDMS Streaming • DIAdem Post-processing • Selected Architecture: • Band-Aids and Duct Tape NIWeek 2011 Hummer Demo
  • 9. 9ni.com Coupling is OftenAccidental: Case Study Final Demo Code • Once • Once you start…you can’t stop • You can’t test independent actions • There are 7 shift registers: • State • DAQ Settings • TDMS Settings • Errors • DIAdem References • IMAQ Settings • CAN Settings • Whether used or not, every shift register goes across every case
  • 10. 10ni.com While Loop Cohesion: Limiting Process Scope • Often, shift register defines scope of process • Processes should be very cohesive • Independent processes should be separate loops » DAQ » » TDMS » » User Interface » » State Information » Multiple shift registers for one process indicate over-coupling X X X
  • 11. 11ni.com The Rewritten Hummer Demo Using a Queued Message Handler Architecture •O n c e •Once
  • 12. 12ni.com DAQ Application Event-Driven Loop How to De-Couple Independent Processes Best Practices 1. Identify data scope 2. Delegate actions to appropriate process 3. Avoid polling or using timeouts* *except for code that communicates with hardware Considerations 1. How do you send commands? 2. How do you send data? 3. Which processes can communicate with each other? 4. How do you update the UI? ?
  • 13. 13ni.com Inter-Process Communication ensures tasks run asynchronously and efficiently Goals • Loops are running independently • User interface can be updated every 20 ms • Acquisition runs every 10ms, helping to not overflow the buffer • All while loops run entirely parallel with each other While Loop Acquire While Loop Analyze While Loop Present While Loop Log 10ms 50ms 250ms 20ms …How?
  • 14. 14ni.com Many Data Communication Options Exist in LabVIEW 1. TCP and UDP 2. Network Streams 3. Shared Variables 4. DMAs 5. Web Services 6. Peer-to-Peer Streaming 7. Queues 8. Dynamic Events 9. Functional Global Variables 10. RT FIFOs 11. Datasocket 12. Local Variables 13. Programmatic Front Panel Interface 14. Target-scoped FIFOs 15. Notifiers 16. Simple TCP/IP Messaging 17. AMC 18. HTTP 19. FTP 20. Global variables … just to name a few! In no particular order…
  • 15. 15ni.com “Don’t Re-invent the Wheel… …or Worse, a Flat Tire.” -Head First Design Patterns
  • 16. 16ni.com What is a design pattern and why use one? • Definition: • A general reusable approach to a commonly occurring problem • Well-established, proven techniques • A formalized best practice • Not a finished design • Design patterns: • Save time • Improve code readability • Simplify code maintenance
  • 17. 17ni.com What is the difference between a design pattern and a framework? Design Pattern • Focuses on a specific problem • Geared toward solo developers • More foundational Framework • Focuses on larger applications • Geared toward team development • Often involve an architect
  • 18. 18ni.com Design Patterns are not Specific to LabVIEW • Design Patterns: Elements of Reusable Object-Oriented Software, 1994 • Includes examples in C++, Smalltalk • The LabVIEW community has adopted and extended several design patterns for use with LabVIEW • Examples: o Producer / Consumer o State Machine o Queued Message Handler o Factory Pattern o Singleton Pattern
  • 19. 19ni.com RisksAssociated with a “Flat Tire” (Poor Application Design) • Nothing happens when you press “Stop” • Poor error handling • No consistent style • Complicated maintenance and debugging • Difficulty scaling application • Tight coupling, poor cohesion
  • 20. 20ni.com Inter-Process Communication • Store Data • Stream Data • Send Message Many more variations, permutations, and design considerations Typically straightforward use cases with limited implementation options
  • 21. 21ni.com Functional Global Variables • What is a functional global variable (FGV)? • Does the FGV prevent race conditions?
  • 22. 22ni.com De-Facto Communication Choice: Locals / Globals • Local and Global variables are simple and obvious • Text-based mindset isn’t used to parallel programs, multithreading • Problem: Locals / Globals are pure data storage and could cause race conditions “The traditional, text-based programmer’s first instinct is always to use local variables.” – Brian Powell
  • 23. 23ni.com What is a Functional Global Variable? • The general form of a functional global variable includes an uninitialized shift register (1) with a single iteration While Loop 1. Functional Global Variable Code
  • 24. 24ni.com What is a Functional Global Variable? • A functional global variable usually has an action input parameter that specifies which task the VI performs • The uninitialized shift register in a loop holds the result of the operation
  • 25. 25ni.com Sidebar: Reentrant vs. Non-Reentrant • Non-reentrancy is required for FGVs • Reentrancy allows one subVI to be called simultaneously from different places • To allow a subVI to be called in parallel • To allow a subVI instance to maintain its own state Data Space Data Space Data Space State (or the data that resides in the uninitialized shift register) is maintained between all instances of the FGV
  • 26. 26ni.com Various Inter-process Communication Methods Exist • FGVs are one tool of many in the toolbox: Same target Same application instance Same target, different application instances / Different targets on network Storing - Current Value • Single-process shared variables • Local and global variables • FGV, SEQ, DVR • CVT • Notifiers (Get Notifier) • Network-published shared variables (single-element) • CCC Sending Message • Queues (N:1) • User events (N:N) • Notifiers (1:N) • User Events • TCP, UDP • Network Streams (1:1) • AMC (N:1) • STM (1:1) Streaming • Queues • Network Streams • TCP
  • 27. 27ni.com What Else Do I Need to Know? • Store Data • Stream Data • Send Message Many more variations, permutations, and design considerations Typically straightforward use cases with limited implementation options
  • 28. 28ni.com Queued Message Handlers • What are Queues? • What is the Queued Message Handler (QMH)? • Basic modifications to the QMH template
  • 29. 29ni.com Adding Elements to the Queue Dequeueing Elements Reference to existing queue in memory Select the data type the queue will hold Dequeue will wait for data or time-out (defaults to -1) Queues 101: Inter-Process Communication
  • 30. 30ni.com Producer Consumer Generalization Thread 1 Thread 2 Thread 3 Best Practices 1. One consumer per queue 2. Keep at least one reference to a named queue available at any time 3. Consumers can be their own producers 4. Do not use variables Considerations 1. How do you stop all loops? 2. What data should the queue send? QUEUE QUEUE
  • 31. 31ni.com Anatomy of a “Producer” Process Process Stop Condition Met? Send InformationData Information Action or Event Sends message to other process, program, or target
  • 32. 32ni.com Anatomy of a Message Producer Process Process Stop Condition Met? Inter-Process CommunicationData Command Action or Event Sends message to other process, program, or target Message comprised of a command and optional data
  • 33. 33ni.com Constructing a Message Examples: Data Variant allows data-type to vary. Different messages may require different data. Command Enumerated constants (or strings) list all of the options. Command Data Initialize UI Cluster containing configuration data Populate Menu Array of strings to display in menu Resize Display Array of integers [Width, Height] Load Subpanel Reference of VI to Load Insert Header String Stop -
  • 34. 34ni.com Sidebar: Enums versus Strings for Commands? Enumerated Constant • Safer to use – prevents misspellings • Compiler checks for message validity • Requires a copy for each API (e.g. “Initialize”) • “Add case for every value” String • Misspellings could lead to runtime errors • Onus is on the developer to get messages correct • Streamlines usage across multiple APIs • Universal data type
  • 35. 35ni.com ? Next Steps FIRST STATE Case structure has a case for every command Next steps could enqueue new action for any other loop, including this one Data cluster for all states After command is executed, data cluster may be updated Queue Reference Command Execution State Specific Data-type Definition Variant To Data Dequeue Action & Data Queued Message Handler “Consumer” Process Defines the scope of operations this consumer can handle Stop Condition Met?
  • 37. 37ni.com Queued Message Handler UI event capture loop Message handling loop Queue setup Template
  • 38. 38ni.com Queued Message Handler UI event capture loop Message handling loop Create queue for message communication and user event to stop event loop Template
  • 39. 39ni.com Queued Message Handler Message handling loop Queue setup Event structure in its own loop String messages added to a queue Template
  • 40. 40ni.com QMH Extends Producer/Consumer SubVI Encapsulation Exit Strategy Standard Cases Basic Controls Included
  • 41. 41ni.com QMH Features Local Data Receive Communication Command: String Data: Variant Event Handler Update local data? Next steps Stop condition met?
  • 42. 42ni.com General Modifications to the QMH Template • Add Interrupt • What if a process needs to disrupt the flow of tasks (e.g. Emergency stop)? • Add Additional Message Handlers • Add Error Handler • Add Timeout to Dequeue Messages • May want to timeout for regular Update Display execution • …etc. 42
  • 43. 43ni.com Application-Specific Modifications to the QMH • Official Login Process • Operator login and documentation • Customized or Interactive Displays • Different ways of displaying different types of data • Standardized Logging • Company or application specific file formatting and structure • …etc. 43
  • 44. 44ni.com Summary and Next Steps • FGVs are an effective data storage mechanism • Action engines prevent race conditions • The QMH is really a starting point • It will get you really far, but… • It is frequently customized • It is frequently one component in a larger framework • Next Steps: • Advanced Architectures in LabVIEW CustEd Course • History Probe for keeping track of actions: https://decibel.ni.com/content/docs/DOC-1106
  • 45. 45ni.com Solution Sources Programming, Inc. Company History • Est. 1990 • Headquartered in San Jose, CA • Support Requirements Worldwide Expertise • Turnkey Engineering & Production Test Systems • LabVIEW, TestStand, LabWindowsCVI Industries • Aerospace & Defense • Consumer Electronics • Green Technologies • Medical and Life Sciences • RF and Wireless • Semiconductor Contact us www.ssprog.com sales@ssprog.com 408-487-0270