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

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

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
197
Chapter 08_
자바스크립트 MV* 패턴
다는 능동적으로 볼 수 있으며,
MVC
와
MVP
의 뷰도 마찬가지입니다. 허나
MVC
,
MVP
,
MVVM
에서 뷰는 수동적일 수도 있다고 하는데 무슨 뜻일까요?
수동적 뷰는 단순히 화면을 출력할 뿐 사용자의 입력을 받아들이지 않습니다. 이러한 뷰는
애플리케이션의 모델에 대한 구체적인 정보를 가지고 있지 않을 수 있으며, 프리젠터에 의해
조작될 수 있습니다. 반면,
MVVM
의 능동적 뷰는 데이터 바인딩, 이벤트, 동작들을 포함하
고 있어 뷰모델에 대한 이해를 필요로 합니다. 비록 이러한 동작들이 속성에 연결될 수는 있
지만, 뷰모델로부터 발생한 이벤트를 처리하는 책임은 여전히 뷰가 갖고 있습니다.
중요한 점은 뷰는 상태를 관리할 책임이 없다는 것입니다. 뷰는 뷰모델과 정보 또는 상태를
항상 동기화된 상태로 유지하기 때문입니다.
8.7.4
뷰모델
뷰모델
ViewModel
은 데이터 변환기의 역할을 하는 특수한 컨트롤러로 볼 수 있습니다. 모델의
정보를 뷰가 사용할 수 있는 형태로 변환하고, 뷰에서 발생한 명령(사용자의 조작이나 이벤
트)을 모델로 전달합니다.
예를 들어,
UNIX
포맷의 날짜 속성 (예:
1333832407
)을 가지고 있는 모델이 있다고 가정해
봅시다. 모델이 사용자가 보게 될 날짜 표시 방식(예:
04
/
07
/
2012
@
5
:
00
pm
)으로 형식을
바꾸어 저장하는 게 아니라, 원시 포맷 그대로 유지합니다. 뷰에는 포맷된 날짜가 표시되고,
뷰모델은 뷰와 모델 둘 사이를 잇는
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