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
オープンウェイトのLLMリランカーを契約書で評価する / searchtechjp
sansan_randd
3
650
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
330
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
290
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
780
Meshy Proプラン課金した
henjin0
0
250
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
Featured
See All Featured
The browser strikes back
jonoalderson
0
360
How STYLIGHT went responsive
nonsquared
100
6k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
ラッコキーワード サービス紹介資料
rakko
1
2.2M
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Documentation Writing (for coders)
carmenintech
77
5.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
62
Designing for Performance
lara
610
70k
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