Wh op ps! W hf re did my archi tf cture go? In betw ef n a m oo olith ao d a sys tf m of sys tf ms mess… � / � @ olivergierke
Background C oo sulting & engin ef ring @ Pivotal Lots of code reviews Eoin W op ds‘ talk oo InfoQ
Roadmap Divide ao d c oo quer Of l az ers ao d slices T hf modular m oo olith
Divide and conquer
Comp oo ent Single unit to underst ao d
Comp oo ent Single unit to ch ao ge
Comp oo ent Scope of r it k of ch ao ge
A B Sma lm er unit to underst ao d
A B Reduced r it k of ch ao ge
A B Cost of sf parati oo
A B Definiti oo ao d main tf n ao ce of dependencies
Of layers and slices…
Bi lm ing Inventory Order Pre sf ntati oo Service Data Access
Layers We lm underst op d Known to developers Less import ao t to business
Slices Hardly underst op d New to developers Key for business requirements
Bi lm ing Inventory Order Pre sf ntati oo Service Data Access
Monolith VS. System of Systems
Order Order Bi lm ing Bi lm ing Inventory Inventory M oo olith VS. Sys tf m of Sys tf ms
Order Order Bi lm ing Bi lm ing Inventory Inventory In-process ca lm s VS. In tf r-process ca lm s
Order Order Bi lm ing Bi lm ing Inventory Inventory Perform ao ce? Over hf ad? Error scenarios?
" If you can’t build a modular monolith, why do you think microservices are the answer? — Simon Brown
How to manage modularity in different architectural contexts?
Order Order Bi lm ing Bi lm ing Inventory Inventory Me ao s to enforce c ootf xt b ov ndaries?
The modular monolith
How to implement a modular monolith?
How to maintain a modular monolith?
Bounded Context all the things! Domain-Driven Design it a great idea! Surpr it e! In a m oo olith, t op !
Architecturally- evident code
Code analysis jDepend S oo arcube Structure 101 / S oo argraph jQAss it t ao t
A plain Java based approach
How to write code that’s less likely to deteoriate?
Bi lm ing Inventory Orders Pre sf ntati oo Service Data Access
Packages
….layer.slice ….slice.layer ….slice
….web.core ….service.core ….repository.core
….core.web ….core.service ….core.repository
….core ….customer ….account
Does it make a difference?
Dependency management
Orders Orders Bi lm ing Bi lm ing Inventory Inventory
Orders Bi lm ing Inventory A rule violati oo it just ao @Inject aw az !
You only need to manage what you can refer to…
Layers first Lea kt slice in tf rna lt Lower l az ers v it ible to every oo e
N ef ds to be public :( A lm ows ot hf r code to circumvent business logic
Slices only K ef ps tf chnical div it i oo priva tf Encapsula tf s business module In tf rna lt underst op d ao yw az
A lm package pro tf c tf d Compiler induced dependency c oo trol
Bi lm ing Inventory Order Pre sf ntati oo Service Data Access
Bi lm ing Inventory Order Pre sf ntati oo Service Data Access
Resources Blogpost S oo argraph jQAss it t ao t Spring Data JPA @ GitHub
Sample Code http://github.com/olivergierke/ wh op ps-archi tf cture
Thanks & Credits Eoin W op ds — Talk @ InfoQ S tf f ao Tilkov — Talk @ InfoQ
Recommend
More recommend