-
Architecture Pattern-MVPAndroid 2020. 9. 2. 18:35반응형
MVP
Model , View , Presenter 의 약자 입니다.
개념
MVC의 Controller 대신에 Presenter로 변경됩니다
Presenter는 View와Model 사이에서 중재자 역할을 합니다.
과정
-
사용자가 View를 통해 이벤트를 전달합니다.
-
Presenter는 View에게 전달받은 이벤트를 처리합니다.
(필요에 의해 Model의 데이터를 가져오거나 업데이트 합니다)
- Presenter에서 View를 업데이트 합니다.
장점
- MVC와 달리 View와 Model이 의존성을 가지지 않습니다.
- Presnter 와 Model은 1:N 관계입니다. (재 사용성 o)
- 유지 보수가 쉽습니다.
- 유닛 테스트에 용이합니다.
단점
- 프로젝트가 커질 수록 코드 자원이 증가 합니다.
반응형'Android' 카테고리의 다른 글
Activity lifecycle (0) 2020.09.02 Architecture Pattern-MVVM (0) 2020.09.02 Architecture Pattern-MVC (0) 2020.09.02 Alarm Manager (0) 2020.09.02 키보드 숨기기 (0) 2020.09.02 -