SlideShare a Scribd company logo
1 of 30
gustav.onecore.cl
Arquitectura
“Si en una sala llena de diseñadores de software dos de ellos
están de acuerdo, eso es una mayoría”
Bill Curtis
Simple application
Create Projects :)
...yeah right
Simple application
Create Projects :)
...yeah right
Simple application
Simple application
:(
MVC comes to rescue you … I think
MVC comes to rescue you
Create Project
POST /v1/customer/1/project
… I think
Web endpoint
MVC comes to rescue you
Create Project
POST /v1/customer/1/project
… I think
Web endpoint
Controller/ProjectController
MVC comes to rescue you
Create Project
POST /v1/customer/1/project
… I think
Web endpoint
Controller/ProjectController
Concrete
Concrete
Concrete
Concrete
Concrete
MVC comes to rescue you
Create Project
POST /v1/customer/1/project
… I think
Web endpoint
Controller/ProjectController
Database context
Web context
Filesystem context
Domain logic wired to different contexts
Web, HTTP
Database, ER manager
Controller, Request
Create
Project
Reuse domain logic in other contexts
editRepository()
Create project
Reuse domain logic in other contexts
editRepository()
Create project
How?
Can I reuse that code?
Summary of pros/cons
Pros
- Rapid application development (R.A.D)
- Low learning curve
- Lots of frameworks in any flavour
- Good documentation
Cons
- Rapid application development (R.A.D) → becomes B.A.D (Bad application development)
- Too much coupling between layers
- Not good abstraction
- Technical debt
- Domain logic wired to the framework
Arquitectura Hexagonal
“Hexagonal Architecture is an architecture defined by establishing a perimeter
around the domain of your application and establishing adapters for input/output
interactions. By establishing this isolation layer, the application becomes unaware of
the nature of the things it's interacting with.”
Alistair Cockburn
Heart of hexagonal architecture
Inner things Outside things
Heart of hexagonal architecture
Inner things Outside things
Decoupled application from dependencies
Ports (have a language)
Adapters (mutate message from port to
application).
All right, a better explanation
Application Port
PortPort
Port
Adapters and Ports
Controller
Request
Form
Entity
Repository
Create Project - POST /customer/1/project
Create project, a better approach
Web endpoint
Create Project - POST /customer/1/project
Create project, a better approach
Web endpoint Web endpoint CreateProject
CreateProjectFolder
CreateProjectEntity
Alright, show me the code...
Adapter mutate message from the
web port
ProjectController
Alright, show me the code...
Adapter mutate message from the
web port
ProjectController
Good abstraction Context: Create a project
Alright, show me the code...
Adapter mutate message from the
web port
CreateProjectCommand
ProjectController
CreateProjectCommand
Hey, but I want to create a command line script too
Be solid, ensure the single responsibility principle of your features.
Reuse your commands
Summary of pros/cons
Pros
- Low technical debt === good architecture
- Decoupled layers
- A good approach for complex applications with several developers
- Good abstraction for the domain logic
- Reuse your beautiful code
Cons
- It’ not too easy to implement as MVC
- In some cases the Hexagonal documentation is too abstract
Preguntas?

More Related Content

What's hot

How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)Matthias Noback
 
Fed London - January 2015
Fed London - January 2015Fed London - January 2015
Fed London - January 2015Phil Leggetter
 
apidays LIVE Australia - Contract-first API development with Spot by Francois...
apidays LIVE Australia - Contract-first API development with Spot by Francois...apidays LIVE Australia - Contract-first API development with Spot by Francois...
apidays LIVE Australia - Contract-first API development with Spot by Francois...apidays
 
Code Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersCode Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersBert Jan Schrijver
 
OpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersOpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersBert Jan Schrijver
 
J-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersJ-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersBert Jan Schrijver
 
BIS07 Application Development - I
BIS07 Application Development - IBIS07 Application Development - I
BIS07 Application Development - IPrithwis Mukerjee
 
What's Coming in C# 9.0
What's Coming in C# 9.0What's Coming in C# 9.0
What's Coming in C# 9.0Moaid Hathot
 
What's coming in c# 9.0
What's coming in c# 9.0What's coming in c# 9.0
What's coming in c# 9.0Moaid Hathot
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLAnton Arhipov
 

What's hot (11)

How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
 
Fed London - January 2015
Fed London - January 2015Fed London - January 2015
Fed London - January 2015
 
apidays LIVE Australia - Contract-first API development with Spot by Francois...
apidays LIVE Australia - Contract-first API development with Spot by Francois...apidays LIVE Australia - Contract-first API development with Spot by Francois...
apidays LIVE Australia - Contract-first API development with Spot by Francois...
 
Code Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersCode Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developers
 
OpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersOpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developers
 
J-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersJ-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developers
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
BIS07 Application Development - I
BIS07 Application Development - IBIS07 Application Development - I
BIS07 Application Development - I
 
What's Coming in C# 9.0
What's Coming in C# 9.0What's Coming in C# 9.0
What's Coming in C# 9.0
 
What's coming in c# 9.0
What's coming in c# 9.0What's coming in c# 9.0
What's coming in c# 9.0
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSL
 

Similar to Construcción de web aps- un enfoque hexagonal

Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET BasicKALIDHASANR
 
Bn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netBn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netconline training
 
Over view of Technologies
Over view of TechnologiesOver view of Technologies
Over view of TechnologiesChris Mitchell
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 uploadDebnath Sinha
 
Serhiy Kalinets "Building Service Mesh with .NET Core"
Serhiy Kalinets "Building Service Mesh with .NET Core"Serhiy Kalinets "Building Service Mesh with .NET Core"
Serhiy Kalinets "Building Service Mesh with .NET Core"Fwdays
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009ken.egozi
 
Language agnostic technologies introduced in pi web-agent 0.4rc2
Language agnostic technologies  introduced in pi web-agent 0.4rc2Language agnostic technologies  introduced in pi web-agent 0.4rc2
Language agnostic technologies introduced in pi web-agent 0.4rc2Andreas Galazis
 
Serverless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhiskServerless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhiskDaniel Krook
 
OpenFest 2016 - Open Microservice Architecture
OpenFest 2016 - Open Microservice ArchitectureOpenFest 2016 - Open Microservice Architecture
OpenFest 2016 - Open Microservice ArchitectureNikolay Stoitsev
 
webdevelopmentppt-210923044639 (1).pptx
webdevelopmentppt-210923044639 (1).pptxwebdevelopmentppt-210923044639 (1).pptx
webdevelopmentppt-210923044639 (1).pptxlearnEnglish51
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-serviceshomeworkping3
 
Introduction to meteor
Introduction to meteorIntroduction to meteor
Introduction to meteorNodeXperts
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)QAware GmbH
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDKIntel® Software
 
.NET Conf 2019 高雄場 - .NET Core 3.0
.NET Conf 2019 高雄場 - .NET Core 3.0.NET Conf 2019 高雄場 - .NET Core 3.0
.NET Conf 2019 高雄場 - .NET Core 3.0Jeff Chu
 
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)Matthias Noback
 
Things to think about while architecting azure solutions
Things to think about while architecting azure solutionsThings to think about while architecting azure solutions
Things to think about while architecting azure solutionsArnon Rotem-Gal-Oz
 

Similar to Construcción de web aps- un enfoque hexagonal (20)

Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
 
Bn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netBn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot net
 
Over view of Technologies
Over view of TechnologiesOver view of Technologies
Over view of Technologies
 
Beyond The MVC
Beyond The MVCBeyond The MVC
Beyond The MVC
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
Serhiy Kalinets "Building Service Mesh with .NET Core"
Serhiy Kalinets "Building Service Mesh with .NET Core"Serhiy Kalinets "Building Service Mesh with .NET Core"
Serhiy Kalinets "Building Service Mesh with .NET Core"
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
 
Language agnostic technologies introduced in pi web-agent 0.4rc2
Language agnostic technologies  introduced in pi web-agent 0.4rc2Language agnostic technologies  introduced in pi web-agent 0.4rc2
Language agnostic technologies introduced in pi web-agent 0.4rc2
 
Serverless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhiskServerless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhisk
 
OpenFest 2016 - Open Microservice Architecture
OpenFest 2016 - Open Microservice ArchitectureOpenFest 2016 - Open Microservice Architecture
OpenFest 2016 - Open Microservice Architecture
 
webdevelopmentppt-210923044639 (1).pptx
webdevelopmentppt-210923044639 (1).pptxwebdevelopmentppt-210923044639 (1).pptx
webdevelopmentppt-210923044639 (1).pptx
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services
 
Introduction to meteor
Introduction to meteorIntroduction to meteor
Introduction to meteor
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
Introduction Into Docker Ecosystem
Introduction Into Docker EcosystemIntroduction Into Docker Ecosystem
Introduction Into Docker Ecosystem
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
 
.NET Conf 2019 高雄場 - .NET Core 3.0
.NET Conf 2019 高雄場 - .NET Core 3.0.NET Conf 2019 高雄場 - .NET Core 3.0
.NET Conf 2019 高雄場 - .NET Core 3.0
 
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
 
Things to think about while architecting azure solutions
Things to think about while architecting azure solutionsThings to think about while architecting azure solutions
Things to think about while architecting azure solutions
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...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
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

Construcción de web aps- un enfoque hexagonal

  • 2. Arquitectura “Si en una sala llena de diseñadores de software dos de ellos están de acuerdo, eso es una mayoría” Bill Curtis
  • 7. MVC comes to rescue you … I think
  • 8. MVC comes to rescue you Create Project POST /v1/customer/1/project … I think Web endpoint
  • 9. MVC comes to rescue you Create Project POST /v1/customer/1/project … I think Web endpoint Controller/ProjectController
  • 10. MVC comes to rescue you Create Project POST /v1/customer/1/project … I think Web endpoint Controller/ProjectController Concrete Concrete Concrete Concrete Concrete
  • 11. MVC comes to rescue you Create Project POST /v1/customer/1/project … I think Web endpoint Controller/ProjectController Database context Web context Filesystem context
  • 12. Domain logic wired to different contexts Web, HTTP Database, ER manager Controller, Request Create Project
  • 13. Reuse domain logic in other contexts editRepository() Create project
  • 14. Reuse domain logic in other contexts editRepository() Create project How?
  • 15. Can I reuse that code?
  • 16. Summary of pros/cons Pros - Rapid application development (R.A.D) - Low learning curve - Lots of frameworks in any flavour - Good documentation Cons - Rapid application development (R.A.D) → becomes B.A.D (Bad application development) - Too much coupling between layers - Not good abstraction - Technical debt - Domain logic wired to the framework
  • 17. Arquitectura Hexagonal “Hexagonal Architecture is an architecture defined by establishing a perimeter around the domain of your application and establishing adapters for input/output interactions. By establishing this isolation layer, the application becomes unaware of the nature of the things it's interacting with.” Alistair Cockburn
  • 18. Heart of hexagonal architecture Inner things Outside things
  • 19. Heart of hexagonal architecture Inner things Outside things
  • 20. Decoupled application from dependencies Ports (have a language) Adapters (mutate message from port to application). All right, a better explanation Application Port PortPort Port
  • 22. Create Project - POST /customer/1/project Create project, a better approach Web endpoint
  • 23. Create Project - POST /customer/1/project Create project, a better approach Web endpoint Web endpoint CreateProject CreateProjectFolder CreateProjectEntity
  • 24. Alright, show me the code... Adapter mutate message from the web port ProjectController
  • 25. Alright, show me the code... Adapter mutate message from the web port ProjectController Good abstraction Context: Create a project
  • 26. Alright, show me the code... Adapter mutate message from the web port CreateProjectCommand ProjectController CreateProjectCommand
  • 27. Hey, but I want to create a command line script too
  • 28. Be solid, ensure the single responsibility principle of your features. Reuse your commands
  • 29. Summary of pros/cons Pros - Low technical debt === good architecture - Decoupled layers - A good approach for complex applications with several developers - Good abstraction for the domain logic - Reuse your beautiful code Cons - It’ not too easy to implement as MVC - In some cases the Hexagonal documentation is too abstract

Editor's Notes

  1. Quiero comenzar por la arquitectura, porque? Porqué necesitamos re-inventar la rueda MVC? Tiene algo de malo? Son quizás varias de las preguntas que muchos se hacen en este momento o se hicieron como yo tiempo atrás, y más aún al escuchar este fancy-name the hexagonal architecture. Bueno, tratemos de ver que esta ocurriendo aún en estos días con el desarrollo de web applications.
  2. Podemos comenzar con una aplicación web simple, algo en lo que todos hemos trabajado alguna vez, y al comienzo es bastante sencillo de crear y mantener, pero esto puede cambiar bastante si otras personas comienzas a trabajar en ella, agregando dependencias, librerías, lógica de negocios etc, haciendo que nuestra simple app, se transforme en esto.
  3. Podemos comenzar con una aplicación web simple, algo en lo que todos hemos trabajado alguna vez, y al comienzo es bastante sencillo de crear y mantener, pero esto puede cambiar bastante si otras personas comienzas a trabajar en ella, agregando dependencias, librerías, lógica de negocios etc, haciendo que nuestra simple app, se transforme en esto.
  4. Con el paso del tiempo, lamentablemente nuestra aplicación sencilla muta a algo enorme que nos comienza a quitar nuestro preciado tiempo. Pero debe haber una mejor forma de hacer las cosas no?
  5. Con el paso del tiempo, lamentablemente nuestra aplicación sencilla muta a algo enorme que nos comienza a quitar nuestro preciado tiempo. Pero debe haber una mejor forma de hacer las cosas no?
  6. Generalmente cuando se habla de una web application, lo primero que pensamos es en MVC, y eso esta ok, ah probado ser una de los estructuras mas expandidas para aplicaciones web, y de hecho muchos frameworks se basan en estos principios. Pero echemos un vistazo con mas detalle de un tipico codigo mvc.
  7. En base a lo anterior, podemos notar que nuestra funcionalidad está fuertemente acoplada al contexto web y al entity manager de objetos ORM de una bd relacional. Entonces, que ocurre con la reusabilidad?, como puedo usar este feature en otros contextos?
  8. Qué ocurriría si estos features fueran necesarios en más contextos?, e.g: Tengo un comando crontab que cada noche revisa usuarios nuevos, creando en forma automática un repositorio, además les envía una notificación por email usando SES y adicionalmente, registra esto en un log no relacional? Simplemente no podría reutilizar.
  9. Qué ocurriría si estos features fueran necesarios en más contextos?, e.g: Tengo un comando crontab que cada noche revisa usuarios nuevos, creando en forma automática un repositorio, además les envía una notificación por email usando SES y adicionalmente, registra esto en un log no relacional? Simplemente no podría reutilizar.
  10. En este tipo de arquitecturas a la aplicación no le interesa ni tampoco le es necesario saber con que dependencias conectará afuera, sino más bien,
  11. Pensemos en esta función que se encarga de editar un objeto de tipo proyecto, la cual es expuesta mediante un endpoint via web. Ciertamente funciona y no parece la gran cosa, pero en realidad si miramos con mayor detalle notaremos la falta de un contexto único que agrupe la idea de “editar un proyecto”. Y esto se aprecia mejor al examinar que este código posee varias llamadas a métodos concretos, o que en sí están relacionado a los detalles de implementación en este caso del entity manager, alejándonos de uno de los principios de OOP, la abstracción. Adicionalmente, podremos notar que este código está fuertemente acoplado al contexto web y una base de datos relacional ORM…. Esto nos deja en serios problemas si mas adelante necesitamos que al crear un repositorio en nuestro sistema se llame a otro sistema externo, e.g: webhook para notificar un cambio.
  12. Pensemos en esta función que se encarga de editar un objeto de tipo proyecto, la cual es expuesta mediante un endpoint via web. Ciertamente funciona y no parece la gran cosa, pero en realidad si miramos con mayor detalle notaremos la falta de un contexto único que agrupe la idea de “editar un proyecto”. Y esto se aprecia mejor al examinar que este código posee varias llamadas a métodos concretos, o que en sí están relacionado a los detalles de implementación en este caso del entity manager, alejándonos de uno de los principios de OOP, la abstracción. Adicionalmente, podremos notar que este código está fuertemente acoplado al contexto web y una base de datos relacional ORM…. Esto nos deja en serios problemas si mas adelante necesitamos que al crear un repositorio en nuestro sistema se llame a otro sistema externo, e.g: webhook para notificar un cambio.
  13. Pensemos en esta función que se encarga de editar un objeto de tipo proyecto, la cual es expuesta mediante un endpoint via web. Ciertamente funciona y no parece la gran cosa, pero en realidad si miramos con mayor detalle notaremos la falta de un contexto único que agrupe la idea de “editar un proyecto”. Y esto se aprecia mejor al examinar que este código posee varias llamadas a métodos concretos, o que en sí están relacionado a los detalles de implementación en este caso del entity manager, alejándonos de uno de los principios de OOP, la abstracción. Adicionalmente, podremos notar que este código está fuertemente acoplado al contexto web y una base de datos relacional ORM…. Esto nos deja en serios problemas si mas adelante necesitamos que al crear un repositorio en nuestro sistema se llame a otro sistema externo, e.g: webhook para notificar un cambio.
  14. Pensemos en esta función que se encarga de editar un objeto de tipo proyecto, la cual es expuesta mediante un endpoint via web. Ciertamente funciona y no parece la gran cosa, pero en realidad si miramos con mayor detalle notaremos la falta de un contexto único que agrupe la idea de “editar un proyecto”. Y esto se aprecia mejor al examinar que este código posee varias llamadas a métodos concretos, o que en sí están relacionado a los detalles de implementación en este caso del entity manager, alejándonos de uno de los principios de OOP, la abstracción. Adicionalmente, podremos notar que este código está fuertemente acoplado al contexto web y una base de datos relacional ORM…. Esto nos deja en serios problemas si mas adelante necesitamos que al crear un repositorio en nuestro sistema se llame a otro sistema externo, e.g: webhook para notificar un cambio.
  15. Pensemos en esta función que se encarga de editar un objeto de tipo proyecto, la cual es expuesta mediante un endpoint via web. Ciertamente funciona y no parece la gran cosa, pero en realidad si miramos con mayor detalle notaremos la falta de un contexto único que agrupe la idea de “editar un proyecto”. Y esto se aprecia mejor al examinar que este código posee varias llamadas a métodos concretos, o que en sí están relacionado a los detalles de implementación en este caso del entity manager, alejándonos de uno de los principios de OOP, la abstracción. Adicionalmente, podremos notar que este código está fuertemente acoplado al contexto web y una base de datos relacional ORM…. Esto nos deja en serios problemas si mas adelante necesitamos que al crear un repositorio en nuestro sistema se llame a otro sistema externo, e.g: webhook para notificar un cambio.