SlideShare a Scribd company logo
Ports-and-Adapters
Architecture for
Embedded HMIs
Burkhard Stubert
The Specialist in Smart User Interfaces
for Industrial Machinery
Qt Greece, 2023-11-24, Athens
Ports-and-Adapters
Architecture
• De-Facto Standard Architecture
• Motivation: USB Adapters
• Production Perspective
• Testing Perspective
• Team Perspective
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 2
Forces Shaping the Architecture
2012
2023?
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 3
Operating
Conditions
IoT
Cloud
Machine
Cloud
Providers
Drivers
Agencies
Farmers
Manufacturer
Suppliers
Developers
Designers
Technology
Trends
Market
Trends
Regulations
Slow: Finding Your Best Architecture
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 4
All architectures
Good architectures:
Technically sound
Right architectures:
Meeting needs
Successful architectures:
Delivering value
• Takes years
• Needs lot of experience
and trial & error
Fast: De-Facto Standard Architecture
Ports & Adapters
Architecture
Start with de-facto standard
architecture and adapt it!
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 5
• Start using now
• Lots of experience built in
• Known to be good, right
and successful
Ports-and-Adapters
Architecture
• De-Facto Standard Architecture
• Motivation: USB Adapters
• Production Perspective
• Testing Perspective
• Team Perspective
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 6
Fast: De-Facto Standard Architecture
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 7
Computer
USB Port USB Adapter (W)LAN
CAN
BLE
RS232
LTE/5G
Port hides
technology of adapter
from computer
• USB Port: standard interface
• Many USB-to-X adapters
• Different companies build
adapters
Ports-and-Adapters
Architecture
• De-Facto Standard Architecture
• Motivation: USB Adapters
• Production Perspective
• Testing Perspective
• Team Perspective
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 8
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 9
Application
Core
Machine
J1939 Machine
MQTT Machine
Machine Double
CANOpen Machine [CAN]
Machine
UI
Acceptance
Tests
GUI
Voice UI
Driver
[Application Boundary]
Camera
Driven Ports
Driving Ports
Accounting
HMI Terminal Application
Ports-and-Adapters Architecture: Production
Definitions
10
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com)
Port Interface between Core (inside)
and Adapters (outside)
1 Port has 1 or more adapters
Adapter uses or implements a port
Product Adapter used in product
Test Adapter used for testing only
Core implements the rules of the
business domain
a.k.a. business logic
Adapter Port
depends on
Adapter
communicates with
System
Adapter
interacts with
Person
Responsibilities
11
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com)
Application
Core
J1939 Machine
MQTT Machine
CANOpen Machine
Machine
UI
GUI
Voice UI
Application
Core
• Ports hide technology (Qt, SQL, J1939,
etc.) used in adapters from core
• No adapter code in core
• No core code (business rules) in adapters
• Ports make core I/O-free
• Great for testing
• Easily exchange adapters in future
• Core & other adapters won’t notice
• Core drives definition of ports
• Raise abstraction level of ports
• Ports belong to core, not vice versa
• Adapters depend on ports and core:
Never the other way round!
• Apply dependency inversion
Ports-and-Adapters
Architecture
• De-Facto Standard Architecture
• Motivation: USB Adapters
• Production Perspective
• Testing Perspective
• Team Perspective
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 12
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 13
Ports-and-Adapters Architecture: Testing
Application
Core
Machine
J1939 Machine
MQTT Machine
Machine Double
CANOpen Machine [CAN]
Machine
UI
Acceptance
Tests
GUI
Voice UI
Driver
Camera
Accounting
Driving Ports Driven Ports
Test Executable(s)
I/O-Free Acceptance Tests for Core
14
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com)
Application
Core
Machine
Double
Machine
UI
Acceptance
Tests
• Replace product by test adapters
• Test doubles for driven ports
• Test cases for driving ports
• Tests mimick how user interacts with
application
• Tests similar to CLI
• Port is bad interface, if tests duplicate
code from product adapter:
• Abstraction level of port to low
• Core depends on adapter code
• I/O-free acceptance tests for core
• Develop core independently from
adpaters – in different teams
I/O-Based Tests for System Parts
15
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com)
Application
Core
Machine
UI
Acceptance
Tests
DB Double
J1939 Machine
[CAN] Machine
Double
Application
Core
Machine
UI
Acceptance
Tests
J1939 Machine
[CAN] Machine
Double
Local DB
[WLAN] Accounting
Double
• Replace test by product
adapters
• Reduce complexity by keeping
some test doubles
For system simulation:
Introduce simulation
adapters
Ports-and-Adapters
Architecture
• De-Facto Standard Architecture
• Motivation: USB Adapters
• Production Perspective
• Testing Perspective
• Team Perspective
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 16
Ideal Team Structure
17
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com)
• Conways Law:
The software architecture always
mirrors the team structure.
• Inverse Conway Manoeuvre:
• First, define the software architecture.
• Then, define the team structure as mirror
of the software architecture.
Map software architecture
1:1 to team structure
Core Team
UI
Team
Machine
Team
Accounting
Team
• Team responsibilities:
• Core team defines ports and owns them
• UI team is primary driver
• Adapter teams implement ports
• Adapter teams build end-to-end solutions
• Accounting: client and server
• Machine: J1939 adapter layer for all ECUs
Supplier
Manufacturer
Team Structures Shaped by Reality
18
Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com)
• Not enough developers for 4 teams
• First: merge UI into Core team
• Then: Accounting team
• Avoid merging Machine team
Machine
Team
• Other end developed by external team
• Introduce interface on comms link
defined and owned by manufacturer
• Other end doubled for testing
Internal
Machine
Team
Extended
Core Team
[J1939/CAN]
External
Machine
Team
Extended
Core Team
🙏 Thank You 🙏
Mail: burkhard.stubert@embeddeduse.com
Web: https://embeddeduse.com
Newsletter : https://burkhardstubert.substack.com

More Related Content

Similar to Ports-and-Adapters Architecture for Embedded HMI

Audi - TCU Project - H Schumacher
Audi - TCU Project - H SchumacherAudi - TCU Project - H Schumacher
Audi - TCU Project - H Schumacher
mfrancis
 
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
Upendra Kancheti
 
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
Upendra Kancheti
 
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware designUNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
SattiBabu16
 
Karthik-CV
Karthik-CVKarthik-CV
SVS_Resume
SVS_ResumeSVS_Resume
SVS_Resume
Venkata Seshathri
 
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case StudyTraditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Altera Corporation
 
Design & Simulation With Verilog
Design & Simulation With Verilog Design & Simulation With Verilog
Design & Simulation With Verilog
Semi Design
 
Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...
Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...
Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...
KTN
 
Atul_T_Biradar_CV
Atul_T_Biradar_CVAtul_T_Biradar_CV
Atul_T_Biradar_CV
Atul Biradar
 
Improve Time to Market for Industrial Edge Devices
Improve Time to Market for Industrial Edge DevicesImprove Time to Market for Industrial Edge Devices
Improve Time to Market for Industrial Edge Devices
Qt
 
Pico-ITX vs. Q7 & SMARC form factors
Pico-ITX vs. Q7 & SMARC form factorsPico-ITX vs. Q7 & SMARC form factors
Pico-ITX vs. Q7 & SMARC form factors
VIA Embedded
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Intel® Software
 
Ba cnet bldg_auto_solutions_brochure_sb008_a
Ba cnet bldg_auto_solutions_brochure_sb008_aBa cnet bldg_auto_solutions_brochure_sb008_a
Ba cnet bldg_auto_solutions_brochure_sb008_a
alfmich
 
Embedded systems introduction
Embedded systems introductionEmbedded systems introduction
Embedded systems introduction
mohamed drahem
 
PME 2021 Design & Quote.pptx
PME 2021 Design & Quote.pptxPME 2021 Design & Quote.pptx
PME 2021 Design & Quote.pptx
NavedKhan659845
 
Embedded software, hardware design and automation software
Embedded software, hardware design and automation softwareEmbedded software, hardware design and automation software
Embedded software, hardware design and automation software
Paul Dao
 
John Wiedey resume
John Wiedey resumeJohn Wiedey resume
John Wiedey resume
John Wiedey
 
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
François
 
“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...
“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...
“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...
Edge AI and Vision Alliance
 

Similar to Ports-and-Adapters Architecture for Embedded HMI (20)

Audi - TCU Project - H Schumacher
Audi - TCU Project - H SchumacherAudi - TCU Project - H Schumacher
Audi - TCU Project - H Schumacher
 
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
 
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
upendra_8_years_Exp_in_Automotive_Embedded_Systems_Software_V00
 
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware designUNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
 
Karthik-CV
Karthik-CVKarthik-CV
Karthik-CV
 
SVS_Resume
SVS_ResumeSVS_Resume
SVS_Resume
 
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case StudyTraditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
 
Design & Simulation With Verilog
Design & Simulation With Verilog Design & Simulation With Verilog
Design & Simulation With Verilog
 
Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...
Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...
Digital Security by Design: Imperas’ Interests - Simon Davidmann, Imperas Sof...
 
Atul_T_Biradar_CV
Atul_T_Biradar_CVAtul_T_Biradar_CV
Atul_T_Biradar_CV
 
Improve Time to Market for Industrial Edge Devices
Improve Time to Market for Industrial Edge DevicesImprove Time to Market for Industrial Edge Devices
Improve Time to Market for Industrial Edge Devices
 
Pico-ITX vs. Q7 & SMARC form factors
Pico-ITX vs. Q7 & SMARC form factorsPico-ITX vs. Q7 & SMARC form factors
Pico-ITX vs. Q7 & SMARC form factors
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
 
Ba cnet bldg_auto_solutions_brochure_sb008_a
Ba cnet bldg_auto_solutions_brochure_sb008_aBa cnet bldg_auto_solutions_brochure_sb008_a
Ba cnet bldg_auto_solutions_brochure_sb008_a
 
Embedded systems introduction
Embedded systems introductionEmbedded systems introduction
Embedded systems introduction
 
PME 2021 Design & Quote.pptx
PME 2021 Design & Quote.pptxPME 2021 Design & Quote.pptx
PME 2021 Design & Quote.pptx
 
Embedded software, hardware design and automation software
Embedded software, hardware design and automation softwareEmbedded software, hardware design and automation software
Embedded software, hardware design and automation software
 
John Wiedey resume
John Wiedey resumeJohn Wiedey resume
John Wiedey resume
 
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
 
“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...
“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...
“Smarter Manufacturing with Intel’s Deep Learning-Based Machine Vision,” a Pr...
 

Recently uploaded

What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 

Recently uploaded (20)

What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 

Ports-and-Adapters Architecture for Embedded HMI

  • 1. Ports-and-Adapters Architecture for Embedded HMIs Burkhard Stubert The Specialist in Smart User Interfaces for Industrial Machinery Qt Greece, 2023-11-24, Athens
  • 2. Ports-and-Adapters Architecture • De-Facto Standard Architecture • Motivation: USB Adapters • Production Perspective • Testing Perspective • Team Perspective Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 2
  • 3. Forces Shaping the Architecture 2012 2023? Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 3 Operating Conditions IoT Cloud Machine Cloud Providers Drivers Agencies Farmers Manufacturer Suppliers Developers Designers Technology Trends Market Trends Regulations
  • 4. Slow: Finding Your Best Architecture Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 4 All architectures Good architectures: Technically sound Right architectures: Meeting needs Successful architectures: Delivering value • Takes years • Needs lot of experience and trial & error
  • 5. Fast: De-Facto Standard Architecture Ports & Adapters Architecture Start with de-facto standard architecture and adapt it! Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 5 • Start using now • Lots of experience built in • Known to be good, right and successful
  • 6. Ports-and-Adapters Architecture • De-Facto Standard Architecture • Motivation: USB Adapters • Production Perspective • Testing Perspective • Team Perspective Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 6
  • 7. Fast: De-Facto Standard Architecture Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 7 Computer USB Port USB Adapter (W)LAN CAN BLE RS232 LTE/5G Port hides technology of adapter from computer • USB Port: standard interface • Many USB-to-X adapters • Different companies build adapters
  • 8. Ports-and-Adapters Architecture • De-Facto Standard Architecture • Motivation: USB Adapters • Production Perspective • Testing Perspective • Team Perspective Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 8
  • 9. Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 9 Application Core Machine J1939 Machine MQTT Machine Machine Double CANOpen Machine [CAN] Machine UI Acceptance Tests GUI Voice UI Driver [Application Boundary] Camera Driven Ports Driving Ports Accounting HMI Terminal Application Ports-and-Adapters Architecture: Production
  • 10. Definitions 10 Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) Port Interface between Core (inside) and Adapters (outside) 1 Port has 1 or more adapters Adapter uses or implements a port Product Adapter used in product Test Adapter used for testing only Core implements the rules of the business domain a.k.a. business logic Adapter Port depends on Adapter communicates with System Adapter interacts with Person
  • 11. Responsibilities 11 Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) Application Core J1939 Machine MQTT Machine CANOpen Machine Machine UI GUI Voice UI Application Core • Ports hide technology (Qt, SQL, J1939, etc.) used in adapters from core • No adapter code in core • No core code (business rules) in adapters • Ports make core I/O-free • Great for testing • Easily exchange adapters in future • Core & other adapters won’t notice • Core drives definition of ports • Raise abstraction level of ports • Ports belong to core, not vice versa • Adapters depend on ports and core: Never the other way round! • Apply dependency inversion
  • 12. Ports-and-Adapters Architecture • De-Facto Standard Architecture • Motivation: USB Adapters • Production Perspective • Testing Perspective • Team Perspective Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 12
  • 13. Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 13 Ports-and-Adapters Architecture: Testing Application Core Machine J1939 Machine MQTT Machine Machine Double CANOpen Machine [CAN] Machine UI Acceptance Tests GUI Voice UI Driver Camera Accounting Driving Ports Driven Ports Test Executable(s)
  • 14. I/O-Free Acceptance Tests for Core 14 Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) Application Core Machine Double Machine UI Acceptance Tests • Replace product by test adapters • Test doubles for driven ports • Test cases for driving ports • Tests mimick how user interacts with application • Tests similar to CLI • Port is bad interface, if tests duplicate code from product adapter: • Abstraction level of port to low • Core depends on adapter code • I/O-free acceptance tests for core • Develop core independently from adpaters – in different teams
  • 15. I/O-Based Tests for System Parts 15 Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) Application Core Machine UI Acceptance Tests DB Double J1939 Machine [CAN] Machine Double Application Core Machine UI Acceptance Tests J1939 Machine [CAN] Machine Double Local DB [WLAN] Accounting Double • Replace test by product adapters • Reduce complexity by keeping some test doubles For system simulation: Introduce simulation adapters
  • 16. Ports-and-Adapters Architecture • De-Facto Standard Architecture • Motivation: USB Adapters • Production Perspective • Testing Perspective • Team Perspective Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) 16
  • 17. Ideal Team Structure 17 Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) • Conways Law: The software architecture always mirrors the team structure. • Inverse Conway Manoeuvre: • First, define the software architecture. • Then, define the team structure as mirror of the software architecture. Map software architecture 1:1 to team structure Core Team UI Team Machine Team Accounting Team • Team responsibilities: • Core team defines ports and owns them • UI team is primary driver • Adapter teams implement ports • Adapter teams build end-to-end solutions • Accounting: client and server • Machine: J1939 adapter layer for all ECUs
  • 18. Supplier Manufacturer Team Structures Shaped by Reality 18 Copyright 2023, Burkhard Stubert (burkhard.stubert@embeddeduse.com) • Not enough developers for 4 teams • First: merge UI into Core team • Then: Accounting team • Avoid merging Machine team Machine Team • Other end developed by external team • Introduce interface on comms link defined and owned by manufacturer • Other end doubled for testing Internal Machine Team Extended Core Team [J1939/CAN] External Machine Team Extended Core Team
  • 19. 🙏 Thank You 🙏 Mail: burkhard.stubert@embeddeduse.com Web: https://embeddeduse.com Newsletter : https://burkhardstubert.substack.com

Editor's Notes

  1. Architecture shaped by its surrounding ecosystem How does the right architecture look? Lead with questions: Question are the same for QtEmSys, but answers differ and have differerent priorities Questions from different perspectives unearth requirements (= answers)
  2. Ignoring architecture leads to BBoM
  3. You see my learning process over the last 25 years. Start with hexagonal architecture as de-facto standard architecture (presumptive architecture). => Reduces the search space! Fairbanks: “Presumptive architectures are usually successful.” Good = efficient Right = effective
  4. Lets transfer the hardware idea into software
  5. Legend for previous slide: Just as reminder for presenter and as reference for audience Core is your core competence and your compettitive advantage! Core is your business!! Adapters support the domain. Never core business!
  6. No core code in adapters (business rules leaking into adapter): When the ignition is on, an accounting job must be running so that the agency can bill the farmer for the work; job stored in DB. -> More than one adapter involved When the motor is running and the driver is not on the seat, the cutting knives must not rotate or the motor must stop. -> differs from OEM to OEM When the ad-blue level is far too low, the UI must show a warning that the motor will automatically be turned off within 10 seconds.
  7. Lets transfer the hardware idea into software
  8. If not enough developers, use double for some adapters and replace it by product adapter later.
  9. Other end = other ECUs of machine, cloud server for accounting