hexagonal architecture using grails
DESCRIPTION
Instead of following the normal data centric structure in Grails, this presentation describes implementing a highly decoupled, communication centric architecture in Grails.TRANSCRIPT
Grails Hexagonal Architecture
Architecturevs
Design
Limitless OptionsFor Design
Only a few Architectures
ArchitectureIs Philosophy
Grails' 'default'Architecture
Grails' 'default'Architecture
N-Tier
Grails' 'default'Architecture
N-TierData Centric
My Green Field Project
My Green Field Project
Web/ MVC Layer
My Green Field Project
Web/ MVC Layer
Service Layer
My Green Field Project
Web/ MVC Layer
Service Layer
Data Layer
My Green Field Project
Web/ MVC Layer
Service Layer
Data Layer
DataController UserController AuthController
DataService UserService
User
My Green Field Project
Web/ MVC Layer
Service Layer
Data Layer
DataController UserController AuthController
DataService UserService
User
OAuthController
RandomService
UserSupportPoint
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
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
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
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
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
Issues ..
Issues ..
Coupling between tiers
Issues ..
Coupling between tiers
Service Spaghetti
Issues ..
Coupling between tiers
Service Spaghetti
User exposed to data model
Architecture
ArchitectureData Centric
ArchitectureData Centric
N-Tier
I will show you:
I will show you:
Communication Centric
I will show you:
Communication CentricDomain Based
I will show you:
Communication CentricDomain Based
Architecture
I will show you:
HexagonalArchitecture
I will show you:
EventArchitecture
I will show you:
No NewFrameworks
What areEvents?
Asynchronous?
Communication
Imperativeto
Declarative
What isHexagonal?
Hexagonal
●Coined by Alistair Cockburn,
2005ish
●Seperates Core application from Integration with the world
http://alistair.cockburn.us/Hexagonal+architecture
The 'Life Preserver'
Approach
Core Domain
Application PoliciesBusiness Rules
Core Domain
Application PoliciesBusiness Rules
REST
Core Domain
Application PoliciesBusiness Rules
REST
Events
Core Domain
Application PoliciesBusiness Rules
RESTCustomerUI
Events
Core Domain
Application PoliciesBusiness Rules
RESTCustomerUI
Database
Events
'Example'Application
A Core/ Logic Domain
A Business Process
A Business Process
(Workflow)
A Business Process
(Workflow)
Create Document
A Business Process
(Workflow)
Create DocumentCreate Document Review Document
A Business Process
(Workflow)
Create DocumentCreate Document Review Document Approve Document
A Business Process
(Workflow)
Create DocumentCreate Document Review Document Approve Document
Reject
A Business Process
(Workflow)
Create DocumentCreate Document Review Document Approve Document
Reject Insert into System
No Mention ofUser Interface
A User Interface Domain
To The Code!
What Next?
Split DomainsInto Plugins
Split DomainsInto
(Micro)Services
Blatant Promo
Training ...
Blatant Promo
https://skillsmatter.com/conferences/6312-mucon
Training ...
µCon: The Microservices Conference27th, 28th November, London
Questions?
Thank you!
@davidthecoder