Submit Search
Upload
Ports and Adapters Architecture
•
Download as PPTX, PDF
•
6 likes
•
1,498 views
O
ofir attal
Follow
Ports and Adapters Architecture | Hexagonal Architecture
Read less
Read more
Software
Report
Share
Report
Share
1 of 33
Download now
Recommended
Ports and Adapters Architecture - solid
Ports and Adapters Architecture - solid
ofir attal
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
Nirav Desai
El camino a las Cloud Native Apps - Introduction
El camino a las Cloud Native Apps - Introduction
Plain Concepts
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
Dan Jenkins
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
jathanism
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
Building Hierarchy
Building Hierarchy
Mohamed Samy
16 greg hope_com_wics
16 greg hope_com_wics
ashish61_scs
Recommended
Ports and Adapters Architecture - solid
Ports and Adapters Architecture - solid
ofir attal
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
Nirav Desai
El camino a las Cloud Native Apps - Introduction
El camino a las Cloud Native Apps - Introduction
Plain Concepts
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
Dan Jenkins
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
jathanism
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
Building Hierarchy
Building Hierarchy
Mohamed Samy
16 greg hope_com_wics
16 greg hope_com_wics
ashish61_scs
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
ICS
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Janel Heilbrunn
Integrating Ansible Tower with security orchestration and cloud management
Integrating Ansible Tower with security orchestration and cloud management
Joel W. King
Verilog presentation final
Verilog presentation final
Ankur Gupta
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5
ukdpe
GraphQL @ Wix
GraphQL @ Wix
Adir Amsalem
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
PRADEEP
NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#
tcaesvk
Internet of Things: Programming on the edge
Internet of Things: Programming on the edge
Scott Thibault
Online test program generator for RISC-V processors
Online test program generator for RISC-V processors
RISC-V International
Tdd,Ioc
Tdd,Ioc
Antonio Radesca
IoT Protocols Integration with Vortex Gateway
IoT Protocols Integration with Vortex Gateway
Angelo Corsaro
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)
Alok Singh
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
Daniel Fisher
Semplificare l'observability per progetti Serverless
Semplificare l'observability per progetti Serverless
Luciano Mammino
TAXTRON Profile_PDF
TAXTRON Profile_PDF
TAXTRON TECHNOLOGIES
A Graphical Way of Thinking About React Designs
A Graphical Way of Thinking About React Designs
olafnouvortne
MASTER-CLASS: "CODE COVERAGE ON Μ-CONTROLLER" Sebastian Götzinger
MASTER-CLASS: "CODE COVERAGE ON Μ-CONTROLLER" Sebastian Götzinger
Ievgenii Katsan
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris
imec.archive
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
BradBedford3
More Related Content
Similar to Ports and Adapters Architecture
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
ICS
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Janel Heilbrunn
Integrating Ansible Tower with security orchestration and cloud management
Integrating Ansible Tower with security orchestration and cloud management
Joel W. King
Verilog presentation final
Verilog presentation final
Ankur Gupta
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5
ukdpe
GraphQL @ Wix
GraphQL @ Wix
Adir Amsalem
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
PRADEEP
NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#
tcaesvk
Internet of Things: Programming on the edge
Internet of Things: Programming on the edge
Scott Thibault
Online test program generator for RISC-V processors
Online test program generator for RISC-V processors
RISC-V International
Tdd,Ioc
Tdd,Ioc
Antonio Radesca
IoT Protocols Integration with Vortex Gateway
IoT Protocols Integration with Vortex Gateway
Angelo Corsaro
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)
Alok Singh
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
Daniel Fisher
Semplificare l'observability per progetti Serverless
Semplificare l'observability per progetti Serverless
Luciano Mammino
TAXTRON Profile_PDF
TAXTRON Profile_PDF
TAXTRON TECHNOLOGIES
A Graphical Way of Thinking About React Designs
A Graphical Way of Thinking About React Designs
olafnouvortne
MASTER-CLASS: "CODE COVERAGE ON Μ-CONTROLLER" Sebastian Götzinger
MASTER-CLASS: "CODE COVERAGE ON Μ-CONTROLLER" Sebastian Götzinger
Ievgenii Katsan
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris
imec.archive
Similar to Ports and Adapters Architecture
(20)
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Integrating Ansible Tower with security orchestration and cloud management
Integrating Ansible Tower with security orchestration and cloud management
Verilog presentation final
Verilog presentation final
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5
GraphQL @ Wix
GraphQL @ Wix
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#
Internet of Things: Programming on the edge
Internet of Things: Programming on the edge
Online test program generator for RISC-V processors
Online test program generator for RISC-V processors
Tdd,Ioc
Tdd,Ioc
IoT Protocols Integration with Vortex Gateway
IoT Protocols Integration with Vortex Gateway
Basics of digital verilog design(alok singh kanpur)
Basics of digital verilog design(alok singh kanpur)
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
Semplificare l'observability per progetti Serverless
Semplificare l'observability per progetti Serverless
TAXTRON Profile_PDF
TAXTRON Profile_PDF
A Graphical Way of Thinking About React Designs
A Graphical Way of Thinking About React Designs
MASTER-CLASS: "CODE COVERAGE ON Μ-CONTROLLER" Sebastian Götzinger
MASTER-CLASS: "CODE COVERAGE ON Μ-CONTROLLER" Sebastian Götzinger
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris
Recently uploaded
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
BradBedford3
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
gurkirankumar98700
buds n tech IT solutions
buds n tech IT solutions
monugehlot87
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
MyIntelliSource, Inc.
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
MyIntelliSource, Inc.
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
aditisharan08
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
Dinusha Kumarasiri
What is Binary Language? Computer Number Systems
What is Binary Language? Computer Number Systems
JheuzeDellosa
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Christina Lin
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
stazi3110
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Ortus Solutions, Corp
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Neo4j
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
OnePlan Solutions
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
kellynguyen01
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
VitsRangannavar
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Wave PLM
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
soniya singh
Asset Management Software - Infographic
Asset Management Software - Infographic
Hr365.us smith
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
Andreas Granig
Recently uploaded
(20)
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
buds n tech IT solutions
buds n tech IT solutions
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
What is Binary Language? Computer Number Systems
What is Binary Language? Computer Number Systems
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Asset Management Software - Infographic
Asset Management Software - Infographic
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
Ports and Adapters Architecture
1.
Ports & Adapters Ofir
Attal, Front End Developer linkedin/ofiratt github.com/ofiratt@Ofir_attalofira@wix.com
2.
Hi. I am Ofir
Attal, a Front End Developer Lithuania Ukraine Vilnius Kiev Dnipro Wix Engineering Locations Israel Tel-Aviv Be’er Sheva
3.
Ports & Adapters Architecture 01
4.
the problem is
Not writing code that works.
5.
the problem is
writing code that is easy to Modify.
6.
✔ Maintainable ✔ Scalable ✔
Easy to add / remove features to you need to understand that your code will change. Good code is:
7.
8.
hexagonal architecture Business Logic Technical Details
9.
Alistair Cockburn
10.
hexagonal architecture Business Logic Technical Details Ports
& Adaptors Ports & Adapters is an architecture, that prevents technical details from infiltrating the business logic.
11.
MotorAdapterAirConditioner Motor +m: Motor +turnOn() +turnOFF() +motor:
MotorAdapter +cool() +stop() +spinCW() +spinCCW() implementing the Adapter pattern Example ... if(roomTemp > desireeTemp) motor.turnOn(); ... ... motor.CCW(); ...
12.
Business Logic Ports Interface -
API The BL “knows it and only it” Adapters Implement the port Keep ‘em Thin! One for each external system
13.
Business Logic Ports Interface -
API The BL “knows it and only it” Adapters Implement the port Keep ‘em Thin! One for each external system
14.
15.
▪ Prevent external
dependencies from leaking into the code ▪ Anti-corruption layer ▪ They’re replaceable Business Logic how adaptors help you
16.
Code Example 02
17.
Tic tac toe let’s
do it!
18.
interface TicTacToePort { markCell(x,
y); ... } import javax.swing.JTextField; AdapterUI implement TicTacToePort { public markCell(row, column) { textField[row][column].setText(‘X’); } } CoreLogic() { TicTacToePort ticTacToePort; think() { if … ticTacToePort.markCell(row, column); } } Tic tac toe business logic
19.
interface TicTacToePort { markCell(x,
y); ... } import javax.swing.JTextField; AdapterUI implement TicTacToePort { public markCell(row, column) { textField[row][column].setText(‘X’); } } CoreLogic() { TicTacToePort ticTacToePort; think() { if … ticTacToePort.markCell(x, y); } } Tic tac toe port
20.
interface TicTacToePort { markCell(row,
column; ... } import javax.swing.JTextField; AdapterUI implement TicTacToePort { public markCell(row, column) { textField[row][column].setText(‘X’); } } CoreLogic() { TicTacToePort ticTacToePort; think() { if … ticTacToePort.markCell(x, y); } } Tic tac toe adapter
21.
UML BL Low Details <<Interface>>
22.
Ports & Adapters TDD 03
23.
Growing Object -
Oriented Software, Guided By Tests. Nat Pryce Easy to classify incidents Business logic Technical details
24.
Growing Object -
Oriented Software, Guided By Tests. Nat Pryce Easy to test the BL in unit tests
25.
Growing Object -
Oriented Software, Guided By Tests. Nat Pryce Easy to validate assumptions in integration tests
26.
OUR SOFTWARE WILL
NEVER BE PERFECT.
27.
public spinTheRolate(int userBetNumber)
{ Random rand; int rolateNumber = rand.nextInt(36); if(userBetNumber == rolateNumber) { system.print.out("user won"); } else { system.print.out("user lost"); } } code Violations
28.
public spinTheRolate(int userBetNumber)
{ Random rand; int rolateNumber = rand.nextInt(36); if(userBetNumber == rolateNumber) { userNotifications.won(); } else { userNotifications.lost(); } } interface UserNotifications { public won(); public lost(); } UserNotificationUI implements UserNotifications { public won() { system.print.out("user won"); } public lost() { system.print.out("user lost"); } } code Violations
29.
private getNewRolateBet() { Random
rand; return rolateNumber = rand.nextInt(36); } public playUserBatFor(int userBetNumber) { if(userBetNumber == getNewRolateBet()) userNotifications.won(); else userNotifications.lost(); } interface UserNotifications { public won(); public lost(); } UserNotificationUI implements UserNotifications { public won() { system.print.out("user won"); } public lost() { system.print.out("user lost"); } } code Violations
30.
1. keep the BUsiness Logic
clean! 2. Keep The adapter thin 2 takeaways for ports & adapters
31.
http://wiki.c2.com/?HexagonalArchitecture http://wiki.c2.com/?PortsAndAdaptersArchitecture https://spin.atomicobject.com/2013/02/23/ports-adapters-software-architecture/ http://alistair.cockburn.us/Hexagonal+architecture http://www.natpryce.com/articles/000772.html https://cleancoders.com/videos/clean-code SOLID videos -
https://cleancoders.com/videos/clean-code/solid-principles resources
32.
Thank You linkedin/ofiratt github.com/ofiratt@Ofir_attalofira@wix.com
33.
Q&A linkedin/ofiratt github.com/ofiratt@Ofir_attalofira@wix.com
Download now