Slide 1

Slide 1 text

Whoops! Where did my architecture go? In between a monolith and a system of systems mess… / @olivergierke

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Background Consulting & engineering @ Pivotal Lots of code reviews Eoin Woods‘ talk on InfoQ

Slide 5

Slide 5 text

Roadmap Divide and conquer Of layers and slices The modular monolith

Slide 6

Slide 6 text

Divide and conquer

Slide 7

Slide 7 text

Component Single unit to understand

Slide 8

Slide 8 text

Component Single unit to change

Slide 9

Slide 9 text

Component Scope of risk of change

Slide 10

Slide 10 text

B Smaller unit to understand A

Slide 11

Slide 11 text

B Reduced risk of change A

Slide 12

Slide 12 text

B Cost of separation A

Slide 13

Slide 13 text

B Definition and maintenance of dependencies A

Slide 14

Slide 14 text

Of layers and slices…

Slide 15

Slide 15 text

Presentation Service Data Access Billing Inventory Order

Slide 16

Slide 16 text

Layers Well understood Known to developers Less important to business

Slide 17

Slide 17 text

Slices Hardly understood New to developers Key for business requirements

Slide 18

Slide 18 text

Presentation Service Data Access Billing Inventory Order

Slide 19

Slide 19 text

Monolith
 VS. System of Systems

Slide 20

Slide 20 text

Monolith VS. System of Systems Order Inventory Billing Order Inventory Billing

Slide 21

Slide 21 text

In-process calls VS. Inter-process calls Order Inventory Billing Order Inventory Billing

Slide 22

Slide 22 text

Performance? Overhead? Error scenarios? Order Inventory Billing Order Inventory Billing

Slide 23

Slide 23 text

" If you can’t build a modular monolith, why do you think microservices are the answer? — Simon Brown

Slide 24

Slide 24 text

How to manage modularity in different architectural contexts?

Slide 25

Slide 25 text

Means to enforce context boundaries? Order Inventory Billing Order Inventory Billing

Slide 26

Slide 26 text

The modular monolith

Slide 27

Slide 27 text

How to implement
 a modular monolith?

Slide 28

Slide 28 text

How to maintain
 a modular monolith?

Slide 29

Slide 29 text

Bounded Context
 all the things! Domain-Driven Design is a great idea! Surprise! In a monolith, too!

Slide 30

Slide 30 text

Architecturally- evident code

Slide 31

Slide 31 text

Code analysis jDepend Sonarcube Structure 101 / Sonargraph jQAssistant

Slide 32

Slide 32 text

A plain Java based approach

Slide 33

Slide 33 text

How to write code that’s less likely to deteoriate?

Slide 34

Slide 34 text

Presentation Service Data Access Billing Inventory Orders

Slide 35

Slide 35 text

Packages

Slide 36

Slide 36 text

….layer.slice ….slice.layer ….slice

Slide 37

Slide 37 text

….web.core ….service.core ….repository.core

Slide 38

Slide 38 text

….core.web ….core.service ….core.repository

Slide 39

Slide 39 text

….core ….customer ….account

Slide 40

Slide 40 text

Does it make a difference?

Slide 41

Slide 41 text

Dependency management

Slide 42

Slide 42 text

Orders Inventory Billing Orders Inventory Billing

Slide 43

Slide 43 text

A rule violation is just an @Inject away! Orders Inventory Billing

Slide 44

Slide 44 text

You only need to manage
 what you can refer to…

Slide 45

Slide 45 text

Layers first Leaks slice internals Lower layers visible to everyone

Slide 46

Slide 46 text

Needs to be public :( Allows other code to circumvent business logic

Slide 47

Slide 47 text

Slices only Keeps technical division private Encapsulates business module Internals understood anyway

Slide 48

Slide 48 text

All package protected Compiler induced dependency control

Slide 49

Slide 49 text

Presentation Service Data Access Billing Inventory Order

Slide 50

Slide 50 text

Presentation Service Data Access Billing Inventory Order

Slide 51

Slide 51 text

Resources Blogpost Sonargraph jQAssistant Spring Data JPA @ GitHub

Slide 52

Slide 52 text

Sample Code http://github.com/olivergierke/
 whoops-architecture

Slide 53

Slide 53 text

Thanks & Credits Eoin Woods — Talk @ InfoQ Stefan Tilkov — Talk @ InfoQ