Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Whoops! Where did my architecture go?
Search
Oliver Drotbohm
October 06, 2015
Programming
4
850
Whoops! Where did my architecture go?
Slides of the talk I gave at Java Forum Nord, 2015.
@springcentral
Oliver Drotbohm
October 06, 2015
Tweet
Share
More Decks by Oliver Drotbohm
See All by Oliver Drotbohm
It Takes Two to Tango – Designing Module Interactions in Modulithic Spring Applications
olivergierke
5
590
Bottom-Up Architecture – Bridging the Achitecture Code Gap
olivergierke
4
840
Spring Modulith – A Deep Dive
olivergierke
7
4.1k
Spring for the Architecturally Curious Developer
olivergierke
5
1.8k
Spring Boot 3 & Spring Framework 6
olivergierke
4
2k
Architecturally-evident Java Applications with jMolecules
olivergierke
8
2.8k
A Deep Dive into Spring Application Events
olivergierke
12
3.2k
Building Better Monoliths – Modulithic Applications with Spring Boot
olivergierke
4
920
Spring HATEOAS – Hypermedia APIs with Spring
olivergierke
1
700
Other Decks in Programming
See All in Programming
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
1
630
Rubyと自由とAIと
yotii23
6
1.8k
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
160
Domain-Driven Design (Tutorial)
hschwentner
13
22k
技術を改善し続ける
gumioji
0
150
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
220
Better Code Design in PHP
afilina
0
180
推しメソッドsource_locationのしくみを探る - はじめてRubyのコードを読んでみた
nobu09
2
340
Jakarta EE meets AI
ivargrimstad
0
530
複数のAWSアカウントから横断で 利用する Lambda Authorizer の作り方
tc3jp
0
120
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
250
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
It's Worth the Effort
3n
184
28k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Visualization
eitanlees
146
15k
Side Projects
sachag
452
42k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
For a Future-Friendly Web
brad_frost
176
9.6k
Transcript
Whoops! Where did my architecture go? Architecture management for Java
applications / olivergierke
None
None
Background Consulting years for SpringSource Lots of code reviews Eoin
Woods‘ talk on InfoQ Lot of input from fellows
"If you think architecture is expensive, try no architecture.
"Architecture is like weather: you can’t have none.
Macro VS. Micro Architecture
Macro VS. Micro Architecture
Orders Inventory Billing Macro-Architecture Micro-Architecture JMS REST AMQP
JRuby Java Scala Macro-Architecture Micro-Architecture AMQP JMS REST
Neo4j RDBMS MongoDB Macro-Architecture Micro-Architecture from Stefan Tilkov - Breaking
the Monolith JMS REST AMQP
Roadmap Divide and conquer Of layers and slices A plain
Java based approach
Architecture 101
Know your dependencies
Explicit / Visible dependencies
Granularity Modules Layers Vertical slices Subsystems
Granularity Java ARchive Package Class
Divide and conquer
Component Single unit to understand
Component Single unit to change
Component Scope of risk of change
B Smaller unit to understand A
B Reduced risk of change A
B Cost of separation A
B Definition and maintenance of dependencies A
"Meanwhile, in my friend’s project…
How do I add a feature?
How do I add a feature? New Feature © Eberhard
Wolff
Of layers and slices…
Presentation Service Data Access
Presentation Service Data Access Account Customer Core
Layers Well understood Known to developers Less important to business
Slices Hardly understood New to developers Key for business requirements
Presentation Service Data Access Account Customer Core
"How to implement an architecture inside a codebase?
Architecture VS. Codebase
"How to implement an architecture inside a codebase?
"How to implement an architecture inside a codebase?
"How to maintain an architecture inside a codebase?
Code analysis JDepend Sonarcube
Sonargraph Formerly known as SonarJ
Demo
A plain Java based approach
"How far can we get with plain Java means only?
Presentation Service Data Access Account Customer Core
Packages
….layer.slice ….slice.layer ….slice
….web.core ….service.core ….repository.core
….core.web ….core.service ….core.repository
….core ….customer ….account
"Why the f#$k should I even care?
"Does it make a difference?
Dependency management
"You only need to manage, what you can refer to…
Layers first Leaks slice internals Lower layers visible to everyone
Slices first/only Start with package per slice Expose interfaces and
domain types Keep implementations private
Slices first/only Encapsulates business module Internals understood anyway
"Start with less packages and the least visibility possible…
Presentation Service Data Access Account Customer Core
Presentation Service Data Access Account Customer Core
Demo
Take-aways Know your dependencies On every granularity Start as strict
as possible Get lenient where necessary
Resources Spring Data JPA @ GitHub Sonargraph jQAssistant Blogpost
Sample Code http://github.com/olivergierke/ whoops-architecture
Oliver Gierke Spring Data Project Lead
[email protected]
olivergierke www.olivergierke.de
Thanks & Credits Eoin Woods - Talk @ InfoQ Stefan
Tilkov - Talk @ InfoQ Eberhard Wolff - Slides @ Slideshare