Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JCConf 2022 - Using ArchUnit to test your archi...
Search
Shihyu Ho
October 15, 2022
Technology
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JCConf 2022 - Using ArchUnit to test your architecture
Using ArchUnit to test your architecture
Shihyu Ho
October 15, 2022
More Decks by Shihyu Ho
See All by Shihyu Ho
JCConf 2024 Jib
shihyuho
0
130
hybrid-cloud-seminar.pdf
shihyuho
0
140
JCConf 2021 Access Kubernetes API in Java
shihyuho
0
170
JCConf 2020 Observing in Microservices
shihyuho
0
960
iThome Kubernetes Summit 2018
shihyuho
0
90
JCConf 2016 zookeeper
shihyuho
0
110
Other Decks in Technology
See All in Technology
Obsidian Vault Architectures
x5gtrn
PRO
0
220
AWS Continuum for Penetration Testing に Deep Dive してみる
asanoharuki
2
1.5k
Jev の中身は50行で再現できる。でも本物との差はどこにあるのか
hisuzuya
0
250
Adversary Infrastructure Hunting101
disconinja
0
180
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
140
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
620
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
2
1.9k
AIで選択肢が広がった組織設計の理想と現実
konifar
16
7.3k
渡米前の準備を制す!re:Invent 2026徹底準備術 / The Ultimate Preparation Guide for re:Invent 2026
yuj1osm
1
460
Vibe-to-Spec開発_実践ガイド
happysamurai294
0
130
【Oracle AI SPOTLIGHT ウェビナー】事例から見る!なぜOCIが選ばれたのか ― AI時代のクラウド戦略を紐解く ―
oracle4engineer
PRO
1
140
[General] 개발자로 해외 기업에서 일하기
skydoves
1
190
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Rails Girls Zürich Keynote
gr2m
96
14k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
500
Thoughts on Productivity
jonyablonski
76
5.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Everyday Curiosity
cassininazir
0
380
First, design no harm
axbom
PRO
2
1.4k
ラッコキーワード サービス紹介資料
rakko
5
5.6M
Leo the Paperboy
mayatellez
10
2.4k
Optimizing for Happiness
mojombo
378
71k
Transcript
Using ArchUnit to test your architecture Matt Ho
About me - Hi, I'm Matt 👋 - 松凌科技 Architect
/ R&D - JCConf Speaker -
[email protected]
- https://github.com/shihyuho
放⼼, 這不是在講架構
本節在分享 架構已經在那了 && 該如何確保在持續開發/維運的過程中, 應⽤程式仍 然遵循著架構走
https://www.archunit.org/
ArchUnit Overview - 是⼀個測試套件, 整合了 JUnit 4, JUnit 5 等
- 良好的 Fluent API - 容易延伸擴充 - Apache-2.0 license
運作過程
起⼿式 決定從哪邊開始匯入 bytecodes
起⼿式 定義 Rules
起⼿式 ArchUnit 執⾏得到結果
起⼿式 - Rule Pattern ArchRuleDefinition.GIVEN_OBJECTS .that(). PREDICATE .should(). CONDITION
Controller 命名必須以 ‘Controller’ 結尾 Class Naming
Controller 命名必須以 ‘Controller’ 結尾 Class Naming
Class Naming Controller 命名必須以 ‘Controller’ 結尾
Class Naming Data Access 命名必須以 ‘Dao’ 結尾
Class Naming Data Access 命名必須以 ‘Dao’ 結尾
Class Naming Data Access 命名必須以 ‘Dao’ 結尾
Layered
Layered
Layered
Layered
Layered Architectures.layeredArchitecture() .layer(). PREDICATE .whereLayer(). CONDITION
Layered 定義 3 層 layer 定義依賴關係
General
Freeze - 套⽤在舊的系統中, 超多條違規改不動 ;-(
Freeze - 套⽤在舊的系統中, 超多條違規改不動 ;-( - 好吧, 那就現在開始的程式才檢查 :-)
Freeze - 套⽤在舊的系統中, 超多條違規改不動 ;-( - 好吧, 那就現在開始的程式才檢查 :-) FreezingArchRule.freeze(
ArchRuleDefinition.GIVEN_OBJECTS .that(). PREDICATE .should(). CONDITION )
Freeze
Code Smells
Long Parameter List https://refactoring.guru/smells/long-parameter-list
Large Class https://refactoring.guru/smells/large-class
Long Method https://refactoring.guru/smells/long-method
Recap - 起⼿式 - Naming Rules - Layers Rules -
General Rules - Freezing Rules - Custom Rules - Code Smells
Thank you 🙌