hexagonal architecture using grails

76
Grails Hexagonal Architecture

Upload: david-dawson

Post on 10-May-2015

1.589 views

Category:

Software


3 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Hexagonal Architecture using Grails

Grails Hexagonal Architecture

Page 2: Hexagonal Architecture using Grails

David Dawson

CEO, Principal Consultant

[email protected]

@davidthecoder

Page 3: Hexagonal Architecture using Grails

Architecturevs

Design

Page 4: Hexagonal Architecture using Grails

Limitless OptionsFor Design

Page 5: Hexagonal Architecture using Grails

Only a few Architectures

Page 6: Hexagonal Architecture using Grails

ArchitectureIs Philosophy

Page 7: Hexagonal Architecture using Grails
Page 8: Hexagonal Architecture using Grails

Grails' 'default'Architecture

Page 9: Hexagonal Architecture using Grails

Grails' 'default'Architecture

N-Tier

Page 10: Hexagonal Architecture using Grails

Grails' 'default'Architecture

N-TierData Centric

Page 11: Hexagonal Architecture using Grails
Page 12: Hexagonal Architecture using Grails

My Green Field Project

Page 13: Hexagonal Architecture using Grails

My Green Field Project

Web/ MVC Layer

Page 14: Hexagonal Architecture using Grails

My Green Field Project

Web/ MVC Layer

Service Layer

Page 15: Hexagonal Architecture using Grails

My Green Field Project

Web/ MVC Layer

Service Layer

Data Layer

Page 16: Hexagonal Architecture using Grails

My Green Field Project

Web/ MVC Layer

Service Layer

Data Layer

DataController UserController AuthController

DataService UserService

User

Page 17: Hexagonal Architecture using Grails

My Green Field Project

Web/ MVC Layer

Service Layer

Data Layer

DataController UserController AuthController

DataService UserService

User

OAuthController

RandomService

UserSupportPoint

Page 18: Hexagonal Architecture using Grails

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

Page 19: Hexagonal Architecture using Grails

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

Page 20: Hexagonal Architecture using Grails

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

Page 21: Hexagonal Architecture using Grails

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

Page 22: Hexagonal Architecture using Grails

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

Page 23: Hexagonal Architecture using Grails

Issues ..

Page 24: Hexagonal Architecture using Grails

Issues ..

Coupling between tiers

Page 25: Hexagonal Architecture using Grails

Issues ..

Coupling between tiers

Service Spaghetti

Page 26: Hexagonal Architecture using Grails

Issues ..

Coupling between tiers

Service Spaghetti

User exposed to data model

Page 27: Hexagonal Architecture using Grails
Page 28: Hexagonal Architecture using Grails

Architecture

Page 29: Hexagonal Architecture using Grails

ArchitectureData Centric

Page 30: Hexagonal Architecture using Grails

ArchitectureData Centric

N-Tier

Page 31: Hexagonal Architecture using Grails

I will show you:

Page 32: Hexagonal Architecture using Grails

I will show you:

Communication Centric

Page 33: Hexagonal Architecture using Grails

I will show you:

Communication CentricDomain Based

Page 34: Hexagonal Architecture using Grails

I will show you:

Communication CentricDomain Based

Architecture

Page 35: Hexagonal Architecture using Grails

I will show you:

HexagonalArchitecture

Page 36: Hexagonal Architecture using Grails

I will show you:

EventArchitecture

Page 37: Hexagonal Architecture using Grails

I will show you:

No NewFrameworks

Page 38: Hexagonal Architecture using Grails

What areEvents?

Page 39: Hexagonal Architecture using Grails

Asynchronous?

Page 40: Hexagonal Architecture using Grails

Communication

Page 41: Hexagonal Architecture using Grails

Imperativeto

Declarative

Page 42: Hexagonal Architecture using Grails

What isHexagonal?

Page 43: Hexagonal Architecture using Grails

Hexagonal

●Coined by Alistair Cockburn,

2005ish

●Seperates Core application from Integration with the world

http://alistair.cockburn.us/Hexagonal+architecture

Page 44: Hexagonal Architecture using Grails

The 'Life Preserver'

Approach

Page 45: Hexagonal Architecture using Grails
Page 46: Hexagonal Architecture using Grails

Core Domain

Application PoliciesBusiness Rules

Page 47: Hexagonal Architecture using Grails

Core Domain

Application PoliciesBusiness Rules

REST

Page 48: Hexagonal Architecture using Grails

Core Domain

Application PoliciesBusiness Rules

REST

Events

Page 49: Hexagonal Architecture using Grails

Core Domain

Application PoliciesBusiness Rules

RESTCustomerUI

Events

Page 50: Hexagonal Architecture using Grails

Core Domain

Application PoliciesBusiness Rules

RESTCustomerUI

Database

Events

Page 51: Hexagonal Architecture using Grails

'Example'Application

Page 52: Hexagonal Architecture using Grails
Page 53: Hexagonal Architecture using Grails
Page 54: Hexagonal Architecture using Grails
Page 55: Hexagonal Architecture using Grails

A Core/ Logic Domain

Page 56: Hexagonal Architecture using Grails

A Business Process

Page 57: Hexagonal Architecture using Grails

A Business Process

(Workflow)

Page 58: Hexagonal Architecture using Grails

A Business Process

(Workflow)

Create Document

Page 59: Hexagonal Architecture using Grails

A Business Process

(Workflow)

Create DocumentCreate Document Review Document

Page 60: Hexagonal Architecture using Grails

A Business Process

(Workflow)

Create DocumentCreate Document Review Document Approve Document

Page 61: Hexagonal Architecture using Grails

A Business Process

(Workflow)

Create DocumentCreate Document Review Document Approve Document

Reject

Page 62: Hexagonal Architecture using Grails

A Business Process

(Workflow)

Create DocumentCreate Document Review Document Approve Document

Reject Insert into System

Page 63: Hexagonal Architecture using Grails

No Mention ofUser Interface

Page 64: Hexagonal Architecture using Grails
Page 65: Hexagonal Architecture using Grails

A User Interface Domain

Page 66: Hexagonal Architecture using Grails
Page 67: Hexagonal Architecture using Grails
Page 68: Hexagonal Architecture using Grails

To The Code!

Page 69: Hexagonal Architecture using Grails

What Next?

Page 70: Hexagonal Architecture using Grails
Page 71: Hexagonal Architecture using Grails

Split DomainsInto Plugins

Page 72: Hexagonal Architecture using Grails

Split DomainsInto

(Micro)Services

Page 73: Hexagonal Architecture using Grails

Blatant Promo

Training ...

Page 74: Hexagonal Architecture using Grails

Blatant Promo

https://skillsmatter.com/conferences/6312-mucon

Training ...

µCon: The Microservices Conference27th, 28th November, London

Page 75: Hexagonal Architecture using Grails

Questions?

Page 76: Hexagonal Architecture using Grails

Thank you!

@davidthecoder