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.

Hexagonal Architecture using Grails

2,745 views

Published on

Instead of following the normal data centric structure in Grails, this presentation describes implementing a highly decoupled, communication centric architecture in Grails.

Published in: Software, Technology, Business
  • Be the first to comment

Hexagonal Architecture using Grails

  1. 1. Grails Hexagonal Architecture
  2. 2. David Dawson CEO, Principal Consultant david.dawson@simplicityitself.com @davidthecoder
  3. 3. Architecture vs Design
  4. 4. Limitless Options For Design
  5. 5. Only a few Architectures
  6. 6. Architecture Is Philosophy
  7. 7. Grails' 'default' Architecture
  8. 8. Grails' 'default' Architecture N-Tier
  9. 9. Grails' 'default' Architecture N-Tier Data Centric
  10. 10. My Green Field Project
  11. 11. My Green Field Project Web/ MVC Layer
  12. 12. My Green Field Project Web/ MVC Layer Service Layer
  13. 13. My Green Field Project Web/ MVC Layer Service Layer Data Layer
  14. 14. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User
  15. 15. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User OAuthController RandomService UserSupportPoint
  16. 16. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User 1.2 OAuthController RandomService UserSupportPoint DataController UserController AuthController DataService UserService User OAuthController RandomService UserSupportPoint
  17. 17. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User 1.3 OAuthController RandomService UserSupportPoint DataController UserController AuthController DataService UserService User OAuthController RandomService UserSupportPoint DataService DataService DataService MehServ iceBlahServiceDataService GahService DoWorkService
  18. 18. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User 1.3 OAuthController RandomService UserSupportPoint DataController UserController AuthController DataService UserService User OAuthController RandomService UserSupportPoint DataService DataService DataService MehServ iceBlahServiceDataService GahService DoWorkService VIEWS
  19. 19. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User 1.3 OAuthController RandomService UserSupportPoint DataController UserController AuthController DataService UserService User OAuthController RandomService UserSupportPoint DataService DataService DataService MehServ iceBlahServiceDataService GahService DoWorkService VIEWS
  20. 20. My Green Field Project Web/ MVC Layer Service Layer Data Layer DataController UserController AuthController DataService UserService User 1.3 OAuthController RandomService UserSupportPoint DataController UserController AuthController DataService UserService User OAuthController RandomService UserSupportPoint DataService DataService DataService MehServ iceBlahServiceDataService GahService DoWorkService VIEWS
  21. 21. Issues ..
  22. 22. Issues .. Coupling between tiers
  23. 23. Issues .. Coupling between tiers Service Spaghetti
  24. 24. Issues .. Coupling between tiers Service Spaghetti User exposed to data model
  25. 25. Architecture
  26. 26. Architecture Data Centric
  27. 27. Architecture Data Centric N-Tier
  28. 28. I will show you:
  29. 29. I will show you: Communication Centric
  30. 30. I will show you: Communication Centric Domain Based
  31. 31. I will show you: Communication Centric Domain Based Architecture
  32. 32. I will show you: Hexagonal Architecture
  33. 33. I will show you: Event Architecture
  34. 34. I will show you: No New Frameworks
  35. 35. What are Events?
  36. 36. Asynchronous?
  37. 37. Communication
  38. 38. Imperative to Declarative
  39. 39. What is Hexagonal?
  40. 40. Hexagonal ●Coined by Alistair Cockburn, 2005ish ●Seperates Core application from Integration with the world http://alistair.cockburn.us/Hexagonal+architecture
  41. 41. The 'Life Preserver' Approach
  42. 42. Core Domain Application Policies Business Rules
  43. 43. Core Domain Application Policies Business Rules REST
  44. 44. Core Domain Application Policies Business Rules REST Events
  45. 45. Core Domain Application Policies Business Rules REST Customer UI Events
  46. 46. Core Domain Application Policies Business Rules REST Customer UI Database Events
  47. 47. 'Example' Application
  48. 48. A Core/ Logic Domain
  49. 49. A Business Process
  50. 50. A Business Process (Workflow)
  51. 51. A Business Process (Workflow) Create Document
  52. 52. A Business Process (Workflow) Create DocumentCreate Document Review Document
  53. 53. A Business Process (Workflow) Create DocumentCreate Document Review Document Approve Document
  54. 54. A Business Process (Workflow) Create DocumentCreate Document Review Document Approve Document Reject
  55. 55. A Business Process (Workflow) Create DocumentCreate Document Review Document Approve Document Reject Insert into System
  56. 56. No Mention of User Interface
  57. 57. A User Interface Domain
  58. 58. To The Code!
  59. 59. What Next?
  60. 60. Split Domains Into Plugins
  61. 61. Split Domains Into (Micro)Services
  62. 62. Blatant Promo Training ...
  63. 63. Blatant Promo https://skillsmatter.com/conferences/6312-mucon Training ... µCon: The Microservices Conference 27th , 28th November, London
  64. 64. Questions?
  65. 65. Thank you! @davidthecoder

×