Skip to Content
자바스크립트 + 리액트 디자인 패턴
book

자바스크립트 + 리액트 디자인 패턴

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
192
자바스크립트 + 리액트 디자인 패턴
8.6.1
모델, 뷰, 프리젠터
MVP
에서
P
는 프리젠터
Presenter
를 의미합니다. 프리젠터는 뷰에 대한
UI
비즈니스 로직을 담
당하는 구성 요소입니다.
MVC
와 달리, 뷰에서의 이벤트 호출은 프리젠터로 위임됩니다. 프
리젠터는 뷰와 분리되어 있으며, 인터페이스를 통해 뷰와 통신합니다. 이 방식은 단위 테스
트에서 뷰를 모킹
mocking
10
할 수 있는 등의 많은 장점을 제공합니다 (그림
8
-
2
).
그림
8-2
MVP
패턴
MVP
는 주로 ‘둔한’ 수동형
passive
뷰를 활용하는 구현 방식이 가장 널리 사용됩니다. 수동형
뷰는 로직을 거의 가지고 있지 않습니다.
MVC
와
MVP
는
C
(컨트롤러 )와
P
(프리젠터 )의 역
할이 다르기 때문에 구분됩니다.
MVP
에서
P
는 모델을 관찰하고 모델이 변경될 때 뷰를 업
데이트합니다.
P
는 모델과 뷰를 효과적으로 연결하는데, 이건 원래
MVC
에서 컨트롤러가 담
당하던 역할입니다.
뷰의 요청에 따라, 프리젠터는 사용자 요청과 관련된 작업을 수행하고 데이터를 뷰로 다시
전달합니다. 이를 위해 프리젠터는 데이터를 가져오고, 조작하고, 이 데이터가 어떻게 뷰에
표시되어야 하는지 결정합니다. 일부 구현에서는 프리젠터는 모델에 데이터를 저장하기 위
해 서비스 계층과 상호작용하기도 합니다. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

실전 시계열 분석: 통계와 머신러닝을 활용한 예측 기법

실전 시계열 분석: 통계와 머신러닝을 활용한 예측 기법

박찬성, 에일린 닐슨
클라우드 엔지니어를 위한 97가지 조언

클라우드 엔지니어를 위한 97가지 조언

Emily Freeman, Nathen Harvey, 정기훈(Jung Ki Hun)

Publisher Resources

ISBN: 9791169212571