SlideShare ist ein Scribd-Unternehmen logo
1 von 56
MVVM Pattern & TEST
PRISM LIVE STUDIO
발표자 소개
송유섭
( yoosub.song@navercor.com )
NAVER 8년차 Android 개발자
Android 개발 10년차
발표자 소개
2010년 갤럭시S 출시와 동시에
안드로이드 개발 시작.
Éclair[2.1], Froyo[2.2], GingerBread[2.3]
발표자 소개
Voice Action App - Seri 하지마 – Not Todo List
발표자 소개
발표자 소개
PRISM LIVE STUDIO..?
PRISM LIVE STUDIO?
PRISM LIVE STUDIO?
https://play.google.com/store/apps/details?id=com.prism.live
App Architecture Pattern
App Architecture Pattern?
MVC
MVP
MVVM
Model – View - Controller
Model – View - Presenter
Model – View - ViewModel
App Architecture Pattern?
View
Controlle
r
public class View {} public class Controller {
public View view;
}
View
Controlle
r
public class View {
public Controller ctr;
}
public class Controller {
public View view;
}
App Architecture Pattern?
MVC MVP
Model – View - Controller Model – View - Presenter
View
Model
Controlle
r
View
Model
Presenter
App Architecture Pattern?
MVP MVVM
Model – View - Presenter Model – View - ViewModel
View
Model
Presenter
View
Model
ViewModel
DataBinding
App Architecture Pattern?
MVVM
View
Model
ViewModel
ViewModel은 View를 모른다.
= 모르게 해야만 한다.
App Architecture Pattern?
MVVM
View
Model
ViewModel
DataBinding
https://tv.naver.com/v/4637200
MVVM – ViewModel?
MVVM
ViewModel
AAC
(Android Architecture Component)
ViewModel
MVVM
MVVM
View ViewModel
LogicUI
Interaction
Click
Touch
Long Click
Drag&Drop
Seeking
…
OnPropertyChanged
DataBinding
Model
DB
Network
File
Memory
…
ViewModel은
View를 모른다.
MVVM
MVVM
View ViewModel
디자이너 개발자
사실상 실패…
MVVM
MVVM
View ViewModel
Screen
Data/Logic
DataBinding
MVVM
MVVM
View ViewModel
Screen
Data/Logic
**Binding.java
PRISM의 MVVM..?
PRISM의 화면들
Single Activity
PRISM 개발에서의 이슈
보통의 개발 상황
1 화면 = 1 개발자
PRISM의 개발 상황
1 화면 = N 개발자
PRISM 개발에서의 이슈
하나의 Activity
수많은 View들 (Visibility 관리)
개발자들 사이의 분할(분담)
기능들의 확장성
변경의 용이성
PRISM의 화면들
<include> <ViewStub>
PRISM - <include>, <ViewStub>
view_layout_1.xml
view_layout_2.xml
view_layout_3.xml
PRISM - <include>, <ViewStub>
Live Main
Title
Cancel
Menu
Input Field
PRISM - <include>, <ViewStub>
Live Main
Title
Cancel
Menu
Input Field
Live Main
Title
Input Field
Menu
Cancel
view_live_main.xml
view_title.xml
view_input_field.xml
view_menu.xml
view_cancel.xml
<include>
PRISM - <include>, <ViewStub>
MVVM
View ViewModel
Screen
Data/Logic
**Binding.java
1 : 1
or
1: N
PRISM - <include>, <ViewStub>
MVVM
View ViewModel
Screen
Data/Logic
**Binding.java
1 : 1
PRISM - <include>, <ViewStub>
Live Main
Title
Cancel
Menu
Input Field
Live Main
Title
Input Field
Menu
Cancel
PRISM - <include>, <ViewStub>
Live Main
Title
Cancel
Menu
Input Field
LiveMainViewModel
TitleViewModel
InputFieldViewModel
MenuViewModel
CancelViewModel
PRISM - <include>, <ViewStub>
Live Main
Title
Cancel
Menu
Input Field
Live Main
Title
Input Field
Menu
Cancel
(설명의 편의를 위해…)
이 뒤에서 보여지는 모든 Box는 ViewModel
PRISM – Visibility 관리
Title
Cancel
Menu
Input Field
Title
Cancel
Menu
Input Field가 Gone 되었다.
Input Field가 Hide 되었다.
Input Field가 비활성화 되었다.
=> InputField.enabled = false
PRISM - Visibility 관리
Live Main
Title
Cancel
Menu
Input Field
Live Main
Title
Input Field
Menu
Cancel
PRISM - Visibility 관리
Live Main
Title
Input Field
Menu
Cancel
Parent
Child
Child
Child
Child
Child의 Enable은 Parent가 결정
= Child의 Visibility는 Parent가 결정
그 외는 모두 독립모듈
PRISM - Visibility 관리
Live Main
Title
Input Field
Menu
Cancel
View1
View2
View3
View10
View11
View20
View21
View1-1
View1-2
View3-1
View3-2
View3-3
View20-1
View20-2
View20-3
PRISM - Visibility 관리
Live Main
Title
Input Field
Menu
Cancel
View1
View2
View3
View10
View11
View20
View21
View1-1
View1-2
View3-1
View3-2
View3-3
View20-1
View20-2
View20-3
PRISM - 업무분담
Live Main
Title
Input Field
Menu
Cancel
View1
View2
View3
View10
View11
View20
View21
View1-1
View1-2
View3-1
View3-2
View3-3
View20-1
View20-2
View20-3
PRISM – 이벤트 전달
Live Main
Title
Input Field
Menu
Cancel
View1
View2
View3
View10
View11
View20
View21
View1-1
View1-2
View3-1
View3-2
View3-3
View20-1
View20-2
View20-3
PRISM – 이벤트 전달
public class View1_ViewModel {
public static final int MESSAGE_ONCLICK_BUTTON = 1;
public void onClick() {
sendMessage(MESSAGE_ONCLICK_BUTTON)
}
}
public class View2_ViewModel {
@Subscribe(MESSAGE_ONCLICK_BUTTON)
public void onClickButton() {
…
}
}
Event 발생측
Event 수신측
PRISM – 이벤트 전달
Live Main
Title
Input Field
Menu
Cancel
View1
View2
View3
View10
View11
View20
View21
View1-1
View1-2
View3-1
View3-2
View3-3
View20-1
View20-2
View20-3
PRISM의 Architecture
View – ViewModel은 1:1 관계
View의 Visibility = ViewModel의 enabled
ViewModel의 enabled는 Parent ViewModel에서만..
그 외에는 ViewModel 각각이 모두 독립적 (Dependency 없음)
MVVM의 Testing
Testing
꼭 해야하나..?
왜 해야하지..?
어떤 것을 테스트 해야하지..?
Testing
꼭 해야하나..?
왜 해야하지..?
어떤 것을 테스트 해야하지..?
답을 찾기 위해 먼저 해보기로…
(꼭 MVVM에 관련된 이야기만은 아닙니다..)
Testing
A 상태에서
B 기능을 수행했을 때
C 상태가 되는가?
Testing
View – ViewModel은 1:1관계
DataBinding으로 자동 연결
ViewModel만 Test하면 끝
(ViewModel만 잘 되어있다면 View는 잘 그려진
다)
Testing
작은 기능단위로 묶임
큰 기능을 작은 기능 단위로 잘게 나눔
Testing
androidTest
test
단말에서 직접 테스트
PC상에서 테스트
(Android 환경이 필요한 경우)
(Android 환경이 필요하지 않은 경우)
Context
Activity, Service, BroadcastReceiver, ContentProvider
Testing
Context
LiveMainViewModel (Outer)
LiveMainViewModel (Inner)
Testing
Clean Architecture
Q & A
사전 질문 중...
사전 질문 중...
네이버 개발자들에게 필요한 능력은?
네이버에서 어떻게 안드로이드 개발을 하는지..?
안드로이드 트랜드는..?
현업 개발이란..?

Weitere ähnliche Inhalte

Kürzlich hochgeladen

공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화JMP Korea
 
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석JMP Korea
 
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP Korea
 
데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법JMP Korea
 
JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP Korea
 
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?Jay Park
 
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP Korea
 
JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP Korea
 

Kürzlich hochgeladen (8)

공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화
 
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
 
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
 
데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법
 
JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례
 
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
 
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
 
JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!
 

Empfohlen

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Empfohlen (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

[D2 CAMPUS] Tech meetup(주제 Android) - 네이버 PRISM앱에 MVVM 패턴과 Test를 적용하며 겪은 일들(송유섭)

Hinweis der Redaktion

  1. 위 그룹은 Title에 관한 기능들로 묶일거고 아래 그룹은 Cancel에 관한 기능들로 묶일거다. 이대로 업무분담하면 되는거죠.
  2. 그렇다면 이벤트 전달은?