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
360
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
490
Siri Shortcut的OTT應用
marslin1220
0
2k
Other Decks in Technology
See All in Technology
タイミーのデータモデリング事例と今後のチャレンジ
ttccddtoki
1
250
Model Mondays S2E03: SLMs & Reasoning
nitya
0
230
5min GuardDuty Extended Threat Detection EKS
takakuni
0
180
自律的なスケーリング手法FASTにおけるVPoEとしてのアカウンタビリティ / dev-productivity-con-2025
yoshikiiida
0
220
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
930
CI/CD/IaC 久々に0から環境を作ったらこうなりました
kaz29
1
200
「Chatwork」の認証基盤の移行とログ活用によるプロダクト改善
kubell_hr
1
230
How Community Opened Global Doors
hiroramos4
PRO
1
130
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
120
作曲家がボカロを使うようにPdMはAIを使え
itotaxi
0
360
急成長を支える基盤作り〜地道な改善からコツコツと〜 #cre_meetup
stefafafan
0
150
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
240
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
How GitHub (no longer) Works
holman
314
140k
Practical Orchestrator
shlominoach
188
11k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Producing Creativity
orderedlist
PRO
346
40k
Raft: Consensus for Rubyists
vanstee
140
7k
A better future with KSS
kneath
239
17k
Being A Developer After 40
akosma
90
590k
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