SlideShare uma empresa Scribd logo
1 de 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?

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Último (20)

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 

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

Notas do Editor

  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.