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
Object Relationship
Search
Mars
June 13, 2019
Technology
0
370
Object Relationship
Provide a simple method to draw the class relationship as "Clean Architecture" does.
Mars
June 13, 2019
Tweet
Share
More Decks by Mars
See All by Mars
New Life for Your Product
marslin1220
0
500
Siri Shortcut的OTT應用
marslin1220
0
2.1k
Other Decks in Technology
See All in Technology
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
150
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
330
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
890
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
160
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
460
Digitization部 紹介資料
sansan33
PRO
1
6.8k
生成AI時代にこそ求められるSRE / SRE for Gen AI era
ymotongpoo
5
2.8k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
使いにくいの壁を突破する
sansantech
PRO
1
120
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
680
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
140
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
210
GitHub's CSS Performance
jonrohan
1032
470k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Typedesign – Prime Four
hannesfritz
42
2.9k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Between Models and Reality
mayunak
1
180
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
320
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Prompt Engineering for Job Search
mfonobong
0
160
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
Transcript
Object Relationship from “Clean Architecture”
Self-Introduction 現職偶爾刷存在感的丈夫、陪毛尼 玩的爸爸、剩餘時間拿來寫程式的 工程師 • Twitter: @marslin_dev • Facebook: marslin1220
Relationship in UML
Answer Answer Answer Answer Answer Answer Answer Answer
None
Too Complicated to Remember
To Simplify
To Simplify the Relationship • Use ◦ Association ▪ Aggregation
▪ Composition • Implement ◦ Inheritance ◦ Realization A B Use C D Implement
Advantage A B C D Use Implement E F E
depends on F
Much Easier
Some Examples
Dependency Chain A B C
Dependency Loop A B C
Dependency Inversion A B
Dependency Inversion (con.) A B C (Interface)
Dependency Inversion (con.) A B C (Interface)
Dependency Injection A B
Dependency Injection (con.) A B C (Interface)
The Ways to Package Objects
Package OrdersController OrderServiceImpl SQLOrdersRespository OrdersService OrdersRespository
Package - by Layers web service data OrdersController OrderServiceImpl SQLOrdersRespository
OrdersService OrdersRespository
Package - by Features orders OrdersController OrderServiceImpl SQLOrdersRespository OrdersService OrdersRespository
Package - by Domains domain web database OrdersController OrderServiceImpl SQLOrdersRespository
OrdersService OrdersRespository
Package - by Components web orders OrdersController OrderServiceImpl SQLOrdersRespository OrdersService
OrdersRespository
MVP v.s. MVVM https://medium.com/ios-os-x-development/ios-architecture- patterns-ecba4c38de52
MVP Person (M) GreetingViewController (V) GreetingView GreetingViewPresenter GreetingPresenter (P)
MVVM Person (M) GreetingViewController (V) GreetingViewModelProtocol GreetingViewModel (VM)
Comparison Person (M) GreetingViewController (V) GreetingViewModelProtocol GreetingViewModel (VM) MVVM Person
(M) GreetingViewController (V) GreetingView GreetingViewPresenter GreetingPresenter (P) MVP
Comparison - by Layers Person (M) GreetingViewController (V) GreetingViewModelProtocol GreetingViewModel
(VM) MVVM Person (M) GreetingViewController (V) GreetingView GreetingViewPresenter GreetingPresenter (P) MVP
ViewModel View Model Model View Comparison - by Layers MVVM
Presenter MVP
Comparison - by Layers MVVM MVP Presenter View Model ViewModel
View Model
Comparison - by Domain MVVM MVP Presenter View Model ViewModel
View Model
Reference • Clean Architecture: ◦ https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html • PresentationDomainDataLayering: ◦ https://martinfowler.com/bliki/PresentationDomainDataLayering.html
• iOS Architecture Patterns: ◦ https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52