Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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 Curt...
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
Con...
MVC comes to rescue you
Create Project
POST /v1/customer/1/project
… I think
Web endpoint
Controller/ProjectController
Dat...
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...
Arquitectura Hexagonal
“Hexagonal Architecture is an architecture defined by establishing a perimeter
around the domain of...
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 ri...
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
Create...
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...
Alright, show me the code...
Adapter mutate message from the
web port
CreateProjectCommand
ProjectController
CreateProject...
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 appl...
Preguntas?
Upcoming SlideShare
Loading in …5
×

Construcción de web aps- un enfoque hexagonal

66 views

Published on

Construcción de aplicaciones web usando un enfoque hexagonal.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Construcción de web aps- un enfoque hexagonal

  1. 1. gustav.onecore.cl
  2. 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
  3. 3. Simple application Create Projects :) ...yeah right
  4. 4. Simple application Create Projects :) ...yeah right
  5. 5. Simple application
  6. 6. Simple application :(
  7. 7. MVC comes to rescue you … I think
  8. 8. MVC comes to rescue you Create Project POST /v1/customer/1/project … I think Web endpoint
  9. 9. MVC comes to rescue you Create Project POST /v1/customer/1/project … I think Web endpoint Controller/ProjectController
  10. 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. 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. 12. Domain logic wired to different contexts Web, HTTP Database, ER manager Controller, Request Create Project
  13. 13. Reuse domain logic in other contexts editRepository() Create project
  14. 14. Reuse domain logic in other contexts editRepository() Create project How?
  15. 15. Can I reuse that code?
  16. 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. 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. 18. Heart of hexagonal architecture Inner things Outside things
  19. 19. Heart of hexagonal architecture Inner things Outside things
  20. 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
  21. 21. Adapters and Ports Controller Request Form Entity Repository
  22. 22. Create Project - POST /customer/1/project Create project, a better approach Web endpoint
  23. 23. Create Project - POST /customer/1/project Create project, a better approach Web endpoint Web endpoint CreateProject CreateProjectFolder CreateProjectEntity
  24. 24. Alright, show me the code... Adapter mutate message from the web port ProjectController
  25. 25. Alright, show me the code... Adapter mutate message from the web port ProjectController Good abstraction Context: Create a project
  26. 26. Alright, show me the code... Adapter mutate message from the web port CreateProjectCommand ProjectController CreateProjectCommand
  27. 27. Hey, but I want to create a command line script too
  28. 28. Be solid, ensure the single responsibility principle of your features. Reuse your commands
  29. 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
  30. 30. Preguntas?

×