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
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
350
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
2
180
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
700
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.4k
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.4k
Context Engineeringの取り組み
nutslove
0
330
Greatest Disaster Hits in Web Performance
guaca
0
200
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
180
生成AI時代にこそ求められるSRE / SRE for Gen AI era
ymotongpoo
5
3.1k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Facilitating Awesome Meetings
lara
57
6.8k
How to Ace a Technical Interview
jacobian
281
24k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
For a Future-Friendly Web
brad_frost
182
10k
How to Talk to Developers About Accessibility
jct
2
130
How STYLIGHT went responsive
nonsquared
100
6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
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