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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Webhook best practices for rock solid and resilient deployments
glaforge
1
280
Greatest Disaster Hits in Web Performance
guaca
0
210
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.3k
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
460
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
440
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
240
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
210
20260204_Midosuji_Tech
takuyay0ne
1
150
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
190
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
130
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
330
AI駆動開発を事業のコアに置く
tasukuonizawa
1
160
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Bash Introduction
62gerente
615
210k
Paper Plane
katiecoart
PRO
0
46k
Crafting Experiences
bethany
1
48
The SEO identity crisis: Don't let AI make you average
varn
0
88
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
57
Everyday Curiosity
cassininazir
0
130
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Rails Girls Zürich Keynote
gr2m
96
14k
Abbi's Birthday
coloredviolet
1
4.7k
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