SlideShare a Scribd company logo

Hexagonal Architecture: The Standard for Qt Embedded Applications

I argue that the hexagonal architecture (aka. ports and adapters pattern) should be the standard architecture for Qt embedded HMIs. I first explain the hexagonal architecture and then show a walking skeleton for a harvester terminal.

1 of 27
Download to read offline
Hexagonal
Architecture:
The Standard
for Qt
Embedded
HMIs
Burkhard Stubert
Good, Right and Successful Architectures
All architectures
Good architectures
Technically sound
Right architectures
Meeting stakeholder needs
Successful architectures
Delivering value
Hexagonal
Architecture
Start with de-facto standard
architecture and adapt it!
2021/07/08 (C) Burkhard Stubert 2
Ports-and-Adapters
Architecture
About the Importance of Architecture
2021/11/04 (C) Burkhard Stubert 3
2012
2021?
Architecture is like an iceberg. Only 1/10 is visible.
The Titanic disaster teaches us what happens
when we ignore the other 9/10.
Yours truly
Agenda
• Ports-and-Adapters Architecture
• Significant Requirements
• Machine Component
• Business Logic
• GUI Component
• Creating the Hexagon
• Conclusion
2021/11/04 (C) Burkhard Stubert 4
Ports-And-Adapters Architecture: Idea
USB
CAN
RS232
UART
(W)LAN
HDMI
PC
Port
Adapters
• Standardised USB Port
• Many USB-to-X adapters
• Different companies can build
different adapters
2021/11/04 (C) Burkhard Stubert 5
Ports-And-Adapters Architecture: Pattern
• Port = Interface between BL
(inside) and Adapters (outside)
• Adapter = Uses or implements
Port
• 1 Port has N Adapters
• Port same for all adapters
• Code from inside must not leak
to outside and vice versa
• Inside: models, connections
• Outside: Qt SerialBus, SQL, IPC
2021/11/04 (C) Burkhard Stubert 6
Business Logic
(BL)
GuiPort
MachinePort
GUI Test
Machine Simulator Mock
CLI

Recommended

CapellaDays2022 | NavalGroup | Closing the gap between traditional engineerin...
CapellaDays2022 | NavalGroup | Closing the gap between traditional engineerin...CapellaDays2022 | NavalGroup | Closing the gap between traditional engineerin...
CapellaDays2022 | NavalGroup | Closing the gap between traditional engineerin...Obeo
 
Présentation PFE Module Article GPAO
Présentation PFE Module Article GPAOPrésentation PFE Module Article GPAO
Présentation PFE Module Article GPAOahmedmiha
 
Autotuning for dcs800
Autotuning for dcs800 Autotuning for dcs800
Autotuning for dcs800 Mahmoud Hassan
 
Introduction to Capella and Arcadia with a Simple System
Introduction to Capella and Arcadia with a Simple SystemIntroduction to Capella and Arcadia with a Simple System
Introduction to Capella and Arcadia with a Simple SystemObeo
 
MBSE and Model-Based Testing with Capella
MBSE and Model-Based Testing with CapellaMBSE and Model-Based Testing with Capella
MBSE and Model-Based Testing with CapellaObeo
 
Scripting with Python to interact with Capella model
Scripting with Python to interact with Capella modelScripting with Python to interact with Capella model
Scripting with Python to interact with Capella modelObeo
 

More Related Content

What's hot

Large scale topological optimisation: aircraft engine pylon case
Large scale topological optimisation: aircraft engine pylon caseLarge scale topological optimisation: aircraft engine pylon case
Large scale topological optimisation: aircraft engine pylon caseAltair
 
Maquettes IHM - Présentation USE AGE - 20-02-2014
Maquettes IHM - Présentation USE AGE - 20-02-2014Maquettes IHM - Présentation USE AGE - 20-02-2014
Maquettes IHM - Présentation USE AGE - 20-02-2014Use Age
 
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...Obeo
 
Qorvo QPF4006 39GHz GaN MMIC Front End Module
Qorvo QPF4006 39GHz GaN MMIC Front End ModuleQorvo QPF4006 39GHz GaN MMIC Front End Module
Qorvo QPF4006 39GHz GaN MMIC Front End Modulesystem_plus
 
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first stepsCapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first stepsObeo
 
Schneider Electric Innovation Summit 2016.pptx
Schneider Electric Innovation Summit 2016.pptxSchneider Electric Innovation Summit 2016.pptx
Schneider Electric Innovation Summit 2016.pptxSchneider Electric
 
Soutenance PFE ingénieur génie logiciel
Soutenance PFE ingénieur génie logicielSoutenance PFE ingénieur génie logiciel
Soutenance PFE ingénieur génie logicielSiwar GUEMRI
 
MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...
MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...
MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...Yole Developpement
 
Tailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UKTailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UKObeo
 
global recruitment services (GPS) A division of saipem
global recruitment services (GPS) A division of saipemglobal recruitment services (GPS) A division of saipem
global recruitment services (GPS) A division of saipemraghunathan janarthanan
 
Plan de sauvegarde automatique sous sql server
Plan de sauvegarde automatique sous sql serverPlan de sauvegarde automatique sous sql server
Plan de sauvegarde automatique sous sql serverMajid CHADAD
 
Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...
Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...
Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...tayebbousfiha1
 
Digitally assisted design for safety analysis
Digitally assisted design for safety analysisDigitally assisted design for safety analysis
Digitally assisted design for safety analysisObeo
 
Guide de production des cours en ligne
Guide de production des cours en ligneGuide de production des cours en ligne
Guide de production des cours en ligneSALMABOUTERRAKA
 
Présentation PFE Mastère PRO
Présentation PFE Mastère PROPrésentation PFE Mastère PRO
Présentation PFE Mastère PROahmedmiha
 
Troubleshooting major causes of rotary joint and rotary union problems
Troubleshooting major causes of rotary joint and rotary union problemsTroubleshooting major causes of rotary joint and rotary union problems
Troubleshooting major causes of rotary joint and rotary union problemsDhiraj siddhapura
 

What's hot (20)

Large scale topological optimisation: aircraft engine pylon case
Large scale topological optimisation: aircraft engine pylon caseLarge scale topological optimisation: aircraft engine pylon case
Large scale topological optimisation: aircraft engine pylon case
 
Maquettes IHM - Présentation USE AGE - 20-02-2014
Maquettes IHM - Présentation USE AGE - 20-02-2014Maquettes IHM - Présentation USE AGE - 20-02-2014
Maquettes IHM - Présentation USE AGE - 20-02-2014
 
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
 
Qorvo QPF4006 39GHz GaN MMIC Front End Module
Qorvo QPF4006 39GHz GaN MMIC Front End ModuleQorvo QPF4006 39GHz GaN MMIC Front End Module
Qorvo QPF4006 39GHz GaN MMIC Front End Module
 
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first stepsCapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
 
Schneider Electric Innovation Summit 2016.pptx
Schneider Electric Innovation Summit 2016.pptxSchneider Electric Innovation Summit 2016.pptx
Schneider Electric Innovation Summit 2016.pptx
 
Soutenance PFE ingénieur génie logiciel
Soutenance PFE ingénieur génie logicielSoutenance PFE ingénieur génie logiciel
Soutenance PFE ingénieur génie logiciel
 
MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...
MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...
MiniLED for Display Applications: LCD and Digital Signage report by Yole Déve...
 
Tailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UKTailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UK
 
PhD Defense
PhD DefensePhD Defense
PhD Defense
 
Exoplayer 2
Exoplayer  2Exoplayer  2
Exoplayer 2
 
global recruitment services (GPS) A division of saipem
global recruitment services (GPS) A division of saipemglobal recruitment services (GPS) A division of saipem
global recruitment services (GPS) A division of saipem
 
Plan de sauvegarde automatique sous sql server
Plan de sauvegarde automatique sous sql serverPlan de sauvegarde automatique sous sql server
Plan de sauvegarde automatique sous sql server
 
Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...
Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...
Rapport de Stage PFE - Développement d'un Projet ALTEN MAROC Concernant le Sy...
 
CFD & ANSYS FLUENT
CFD & ANSYS FLUENTCFD & ANSYS FLUENT
CFD & ANSYS FLUENT
 
Digitally assisted design for safety analysis
Digitally assisted design for safety analysisDigitally assisted design for safety analysis
Digitally assisted design for safety analysis
 
Safely produce
Safely produceSafely produce
Safely produce
 
Guide de production des cours en ligne
Guide de production des cours en ligneGuide de production des cours en ligne
Guide de production des cours en ligne
 
Présentation PFE Mastère PRO
Présentation PFE Mastère PROPrésentation PFE Mastère PRO
Présentation PFE Mastère PRO
 
Troubleshooting major causes of rotary joint and rotary union problems
Troubleshooting major causes of rotary joint and rotary union problemsTroubleshooting major causes of rotary joint and rotary union problems
Troubleshooting major causes of rotary joint and rotary union problems
 

Similar to Hexagonal Architecture: The Standard for Qt Embedded Applications

Ports-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with QtICS
 
CURRICULUM VITAE_Balu
CURRICULUM VITAE_BaluCURRICULUM VITAE_Balu
CURRICULUM VITAE_Balubalakrishna H
 
CADISON world Issue-1-2013
CADISON world Issue-1-2013CADISON world Issue-1-2013
CADISON world Issue-1-2013CADISON
 
Bikram Jeet (Achievements from 2006 - 2013)
Bikram Jeet (Achievements from 2006 - 2013)Bikram Jeet (Achievements from 2006 - 2013)
Bikram Jeet (Achievements from 2006 - 2013)Bikram Jeet
 
Cadison world-issue-01-2013
Cadison world-issue-01-2013Cadison world-issue-01-2013
Cadison world-issue-01-2013CADISON
 
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfOpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfssuser866937
 
ECAD-MCAD Presentation 2011
ECAD-MCAD Presentation 2011ECAD-MCAD Presentation 2011
ECAD-MCAD Presentation 2011Altium
 
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...Igalia
 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt UsersICS
 
Modeling presentation
Modeling presentationModeling presentation
Modeling presentationAditya Dahal
 
Cad automation of electrical busbar
Cad automation of electrical busbarCad automation of electrical busbar
Cad automation of electrical busbarParthiban Kannan
 
Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...
Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...
Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...Intland Software GmbH
 
Sprint 140
Sprint 140Sprint 140
Sprint 140ManageIQ
 
Realize 2022 MINO 7 year of implementation v0.1.pptx
Realize 2022 MINO 7 year of implementation v0.1.pptxRealize 2022 MINO 7 year of implementation v0.1.pptx
Realize 2022 MINO 7 year of implementation v0.1.pptxjakobkuhn
 

Similar to Hexagonal Architecture: The Standard for Qt Embedded Applications (20)

Ports-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
 
CURRICULUM VITAE_Balu
CURRICULUM VITAE_BaluCURRICULUM VITAE_Balu
CURRICULUM VITAE_Balu
 
UNIT 1.pdf
UNIT 1.pdfUNIT 1.pdf
UNIT 1.pdf
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
CADISON world Issue-1-2013
CADISON world Issue-1-2013CADISON world Issue-1-2013
CADISON world Issue-1-2013
 
Bikram Jeet (Achievements from 2006 - 2013)
Bikram Jeet (Achievements from 2006 - 2013)Bikram Jeet (Achievements from 2006 - 2013)
Bikram Jeet (Achievements from 2006 - 2013)
 
Mechatronics engineer
Mechatronics engineerMechatronics engineer
Mechatronics engineer
 
Cadison world-issue-01-2013
Cadison world-issue-01-2013Cadison world-issue-01-2013
Cadison world-issue-01-2013
 
GPGPU using CUDA Thrust
GPGPU using CUDA ThrustGPGPU using CUDA Thrust
GPGPU using CUDA Thrust
 
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfOpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
 
ECAD-MCAD Presentation 2011
ECAD-MCAD Presentation 2011ECAD-MCAD Presentation 2011
ECAD-MCAD Presentation 2011
 
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt Users
 
JAYACHANDRA RESUME
JAYACHANDRA RESUMEJAYACHANDRA RESUME
JAYACHANDRA RESUME
 
Modeling presentation
Modeling presentationModeling presentation
Modeling presentation
 
Cad automation of electrical busbar
Cad automation of electrical busbarCad automation of electrical busbar
Cad automation of electrical busbar
 
Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...
Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...
Bertrandt | Automotive Best Practice: How to Design, Review, Approve, and Eff...
 
Sprint 140
Sprint 140Sprint 140
Sprint 140
 
Realize 2022 MINO 7 year of implementation v0.1.pptx
Realize 2022 MINO 7 year of implementation v0.1.pptxRealize 2022 MINO 7 year of implementation v0.1.pptx
Realize 2022 MINO 7 year of implementation v0.1.pptx
 

Recently uploaded

killing camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfkilling camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfssuser82c38d
 
Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Jeffrey Haguewood
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetMatthewTHawley
 
Orion Context Broker introduction 20240227
Orion Context Broker introduction 20240227Orion Context Broker introduction 20240227
Orion Context Broker introduction 20240227Fermin Galan
 
AI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriAI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriISPMAIndia
 
The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!ISPMAIndia
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfssuser82c38d
 
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A..."Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...ISPMAIndia
 
Welcome to AltTask - the nexus where innovation converges with empowerment!
Welcome to AltTask - the nexus where innovation converges with empowerment!Welcome to AltTask - the nexus where innovation converges with empowerment!
Welcome to AltTask - the nexus where innovation converges with empowerment!alttaskcom
 
Cybersecurity Measures For Remote Workers.pdf
Cybersecurity Measures For Remote Workers.pdfCybersecurity Measures For Remote Workers.pdf
Cybersecurity Measures For Remote Workers.pdfCIOWomenMagazine
 
killing camp 주차장 나누기-2 topology sort.pdf
killing camp 주차장 나누기-2 topology sort.pdfkilling camp 주차장 나누기-2 topology sort.pdf
killing camp 주차장 나누기-2 topology sort.pdfssuser82c38d
 
Implementing Docker Containers with Windows Server 2019
Implementing Docker Containers with Windows Server 2019Implementing Docker Containers with Windows Server 2019
Implementing Docker Containers with Windows Server 2019VICTOR MAESTRE RAMIREZ
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20Shane Coughlan
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementISPMAIndia
 
Role of DevOps in SaaS product Development.pdf.pptx
Role of DevOps in SaaS product Development.pdf.pptxRole of DevOps in SaaS product Development.pdf.pptx
Role of DevOps in SaaS product Development.pdf.pptxMindInventory
 
The Top Outages of 2023: Analyses and Takeaways
The Top Outages of 2023: Analyses and TakeawaysThe Top Outages of 2023: Analyses and Takeaways
The Top Outages of 2023: Analyses and TakeawaysThousandEyes
 
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ..."Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...ISPMAIndia
 
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...Alluxio, Inc.
 
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...emili denli
 

Recently uploaded (20)

killing camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfkilling camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdf
 
Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 Smartsheet
 
Orion Context Broker introduction 20240227
Orion Context Broker introduction 20240227Orion Context Broker introduction 20240227
Orion Context Broker introduction 20240227
 
AI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriAI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit Bendigiri
 
The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdf
 
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A..."Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
 
Welcome to AltTask - the nexus where innovation converges with empowerment!
Welcome to AltTask - the nexus where innovation converges with empowerment!Welcome to AltTask - the nexus where innovation converges with empowerment!
Welcome to AltTask - the nexus where innovation converges with empowerment!
 
Cybersecurity Measures For Remote Workers.pdf
Cybersecurity Measures For Remote Workers.pdfCybersecurity Measures For Remote Workers.pdf
Cybersecurity Measures For Remote Workers.pdf
 
killing camp 주차장 나누기-2 topology sort.pdf
killing camp 주차장 나누기-2 topology sort.pdfkilling camp 주차장 나누기-2 topology sort.pdf
killing camp 주차장 나누기-2 topology sort.pdf
 
eLearning Content Development Company Code and Pixels.pdf
eLearning Content Development Company Code and Pixels.pdfeLearning Content Development Company Code and Pixels.pdf
eLearning Content Development Company Code and Pixels.pdf
 
Implementing Docker Containers with Windows Server 2019
Implementing Docker Containers with Windows Server 2019Implementing Docker Containers with Windows Server 2019
Implementing Docker Containers with Windows Server 2019
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product Management
 
Role of DevOps in SaaS product Development.pdf.pptx
Role of DevOps in SaaS product Development.pdf.pptxRole of DevOps in SaaS product Development.pdf.pptx
Role of DevOps in SaaS product Development.pdf.pptx
 
The Top Outages of 2023: Analyses and Takeaways
The Top Outages of 2023: Analyses and TakeawaysThe Top Outages of 2023: Analyses and Takeaways
The Top Outages of 2023: Analyses and Takeaways
 
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ..."Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
 
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
 
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
 

Hexagonal Architecture: The Standard for Qt Embedded Applications

  • 2. Good, Right and Successful Architectures All architectures Good architectures Technically sound Right architectures Meeting stakeholder needs Successful architectures Delivering value Hexagonal Architecture Start with de-facto standard architecture and adapt it! 2021/07/08 (C) Burkhard Stubert 2 Ports-and-Adapters Architecture
  • 3. About the Importance of Architecture 2021/11/04 (C) Burkhard Stubert 3 2012 2021? Architecture is like an iceberg. Only 1/10 is visible. The Titanic disaster teaches us what happens when we ignore the other 9/10. Yours truly
  • 4. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 4
  • 5. Ports-And-Adapters Architecture: Idea USB CAN RS232 UART (W)LAN HDMI PC Port Adapters • Standardised USB Port • Many USB-to-X adapters • Different companies can build different adapters 2021/11/04 (C) Burkhard Stubert 5
  • 6. Ports-And-Adapters Architecture: Pattern • Port = Interface between BL (inside) and Adapters (outside) • Adapter = Uses or implements Port • 1 Port has N Adapters • Port same for all adapters • Code from inside must not leak to outside and vice versa • Inside: models, connections • Outside: Qt SerialBus, SQL, IPC 2021/11/04 (C) Burkhard Stubert 6 Business Logic (BL) GuiPort MachinePort GUI Test Machine Simulator Mock CLI
  • 7. Product Versions over Time 2021/11/04 (C) Burkhard Stubert 7 Business Logic GUI Machine CAN Business Logic GUI Machine Ethernet Business Logic GUI Machine (IPC) Product v0 Product v1 Product v2 • OTA Updates • Ethernet instead of CAN • Remote diagnostic and support • Message processing in separate process
  • 8. Development and Test Versions 2021/11/04 (C) Burkhard Stubert 8 Business Logic GUI Test Machine Mock Development Testing GUI in system context Business Logic GUI Machine Simulator Business Logic GUI Mock Machine Mock Testing Updates in system context
  • 9. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 9
  • 10. Application Hexagon Architecturally Significant Requirements 2021/11/04 (C) Burkhard Stubert 10 Engine ECU Machine EngineTwin BL MainModel GUI MainView Driver CAN Frame Quantity Object Quantity 930 rpm • Requirement • GUI shows current engine speed. • Constraints • Neither GUI nor BL know that Machine uses CAN • BL provides C++ models for QML GUI • GUI must not depend on Machine
  • 11. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 11
  • 12. Machine Port with Product Adapter (CAN) 2021/11/04 (C) Burkhard Stubert 12 In product_machine.h: QCanBusDevice *m_canBus{QCanBus::instance() ->createDevice("socketcan", "can0")}; CanBusRouter m_router{m_canBus}; EngineTwin m_engine; In product_machine.cpp: ProductMachine::ProductMachine() : Machine{} { QObject::connect( &m_router, &CanBusRouter::newEngineQuantities, &m_engine, &EngineTwin::updateQuantities); In BusinessLogic: Machine::engine() Engine ECU QCanBusDevice CanBusRouter EngineTwin Business Logic can0 Machine SocketCAN frame QCanBusFrame Quantity Quantity Quantity
  • 13. Machine Port with Simulator Adapter 2021/11/04 (C) Burkhard Stubert 13 In simulator_machine.h: CanBusSimulator m_simulator; MockCanBusDevice m_canBus; CanBusRouter m_router{&m_canBus}; EngineTwin m_engine; In simulator_machine.cpp: SimulatorMachine::SimulatorMachine() : Machine{} { QObject::connect( &m_simulator, &CanBusSimulator::newIncomingFrames, &m_canBus, &EngineTwin::appendIncomingFrames); QObject::connect( &m_router, &CanBusRouter::newEngineQuantities, &m_engine, &EngineTwin::updateQuantities); In BusinessLogic: Machine::engine() CanBusSimulator MockCanBusDevice CanBusRouter EngineTwin Business Logic Machine QCanBusFrame QCanBusFrame Quantity Quantity Quantity
  • 14. Test Adapter 2021/11/04 (C) Burkhard Stubert 14 In Machine Test: Machine::engine() MockCanBusDevice CanBusRouter EngineTwin Machine Test Machine QCanBusFrame QCanBusFrame Quantity Quantity Quantity Product Adapter (MQTT) In BusinessLogic: Machine::engine() Engine ECU QNetworkInterface MqttRouter EngineTwin Business Logic eth0 Machine MQTT frame QMqttMessage Quantity Quantity Quantity
  • 15. Creating the Machine Component 2021/11/04 (C) Burkhard Stubert 15 In machine_creator.cpp: Machine *createMachine(Machine::Configuration conf) { switch (conf) { case Machine::Configuration::Product: return new ProductMachine{}; case Machine::Configuration::Simulator: return new SimulatorMachine{}; ... Use createMachine in main()
  • 16. Running Adapter in Thread, Process, MCU Business Logic MachinePort Qt CanBus can0 can1 Business Logic MachinePort Qt CanBus can0 can1 Thread CAN0 Thread CAN1 Qt Signal-Slot Conn. Business Logic MachinePort CAN Bus can0 can1 Thread CAN0 Thread CAN1 Qt Remote Objects Task CAN0 Task CAN1 RPMsg Process 1 on A53 Process 1 on A53 Process 2 on A53 Process 1 on A53 2 Tasks on M4 2021/11/04 (C) Burkhard Stubert 16
  • 17. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 17
  • 18. Business Logic 2021/11/04 (C) Burkhard Stubert 18 In business_logic.h: Q_PROPERTY(MainModel *mainModel READ mainModel CONSTANT) BusinessLogic(std::shared_ptr<Machine> machine, ... , m_machine{machine} In business_logic.cpp: MainModel *BusinessLogic::mainModel() { if (m_mainModel == nullptr) { m_mainModel = new MainModel{this}; connect(m_machine->engine(), &EngineTwin::engineSpeed, m_mainModel, &MainModel::setEngineSpeed); } return m_mainModel; } In MainView.qml: BusinessLogic.mainModel GUI Business Logic Machine EngineTwin MainModel BusinessLogic available as singleton in GUI with models as properties if (m_mainModel == nullptr) { m_mainModel = new MainModel{this}; connect(m_machine->engine(), &EngineTwin::engineSpeed, m_mainModel, &MainModel::setEngineSpeed); } return m_mainModel;
  • 19. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 19
  • 20. GUI with Product Adapter (QML GUI) 2021/11/04 (C) Burkhard Stubert 20 In MainView.qml: import EmUse.Models Pane { property MainModel model: BusinessLogic.mainModel Text { text: Number(model.engineSpeed.value).toFixed(0) } Text { text: model.engineSpeed.unit } MainView Business Logic Machine EngineTwin MainModel
  • 21. GUI Port with Test Adapter 2021/11/04 (C) Burkhard Stubert 21 void TestMainView::init() { m_machine = std::make_shared<Machine>( createMachine(Machine::Configuration::Mock)); m_businessLogic = new BusinessLogic{m_machine}; m_model = m_businessLogic->mainModel(); } void TestMainView::testEngineSpeed() { Quantity rpm{930.0, "rpm"}; emit m_machine->engine()->engineSpeed(rpm); QCOMPARE(m_model->engineSpeed()->quantity(), rpm); } TestMainView Business Logic Machine EngineTwin MainModel Testing GUI in system context • with actual BusinessLogic • with mocks for Machine objects Mocks reused from unit tests of Machine and EngineTwin
  • 22. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 22
  • 23. Composition Root main() 2021/11/04 (C) Burkhard Stubert 23 int main(int argc, char *argv[]) { std::shared_ptr<Machine> machine{ createMachine(Machine::Configuration::Product); }; std::shared_ptr<BusinessLogic> businessLogic{ new BusinessLogic{machine} }; QQmlApplicationEngine appEngine; appEngine.load(u"qrc:/main.qml"_qs); return app.exec(); }
  • 24. Agenda • Ports-and-Adapters Architecture • Significant Requirements • Machine Component • Business Logic • GUI Component • Creating the Hexagon • Conclusion 2021/11/04 (C) Burkhard Stubert 24
  • 25. Pros and Cons of Hexagonal Architecture • High testability • High modularity • High modifiability • High maintainability 2021/11/04 (C) Burkhard Stubert 25 Pros • Additional complexity Cons Succesful architecture for Qt embedded HMIs: Hexagonal Architecture
  • 26. Resources • Alistair Cockburn: Hexagonal Architecture. Original description of the Hexagonal Architecture pattern. • Juan Manuel Garrido de Paz: Ports and Adapters Pattern (Hexagonal Architecture). Detailed explanation of the pattern. • Burkhard Stubert: A Successful Architecture for Qt Embedded Systems. My talk at QtDay Italy 2021. • Burkhard Stubert: Source code for this talk. 2021/11/04 (C) Burkhard Stubert 26
  • 27. 🙏 Thank You 🙏 Mail: burkhard.stubert@embeddeduse.com Web: https://embeddeduse.com Newsletter: http://eepurl.com/gOMQoX

Editor's Notes

  1. Fairbanks: “Presumptive architectures are usually successful.” Good = efficient Right = effective Successful = valuable
  2. Lets transfer the hardware idea into software
  3. The PC with its USB ports becomes the business logic with several APIs or ports If we unfold the adapter-BL-adapter paths of the hexagon, we get multiple instances of 3-layer architecture
  4. The rest of the application does not notice that different ways of communications are used with machine. Remote Diagnostic/Support is just a remote GUI. Remote diagnostic could be mirrored on-board (in the GUI).
  5. This single requirement drives the architecture. Abstraction increases from left to right.
  6. ProductMachine implements the Machine interface CanBusRouter - routes messages to correct ECU twins - decodes/encodes CAN frames to/from Quantities
  7. SimulatorMachine implements the Machine interface Can be used for playing back recorded CAN traces
  8. Use #ifdef’s to get non-product relevant code out the application binary.
  9. Motivation: Avoid GUI freezes & stuttering, avoid buffer overflows How and where CAN adapters run does not matter! MachineAPI is always the same!
  10. The dependency Machine is injected in the constructor. Remove dependency on Machine, if we create ALL models in advance (none on the fly). Performance penalty!
  11. If we start reimplementing parts of MainView.qml in the test, we are violating the model-view pattern!!! Create CLI in similar way!
  12. High testability: “built-in” system and component tests based on unit tests Everything else follows from this!!! High modularity: Different teams develop different components High modifiability: Change adapters without rest of system knowing. Follows open-closed principle High maintainability: Bugs are local to component.