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

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

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
198
자바스크립트 + 리액트 디자인 패턴
8.7.5
뷰와 뷰모델 복습
뷰와 뷰모델은 데이터 바인딩과 이벤트를 통해 소통합니다. 앞서 뷰모델의 초기 예제에서 살
펴본 것처럼, 뷰모델은 모델의 속성을 단순히 제공하는 것뿐만 아니라, 데이터 유효성 검사
같은 다른 메서드와 기능에 대한 접근도 허용합니다.
뷰는 자체
UI
이벤트를 처리하고, 필요에 따라 뷰모델에 연결
mapping
합니다. 모델과 뷰모델의
속성은 양방향 데이터 바인딩을 통해 동기화되고 업데이트됩니다.
또한, 데이터 트리거를 사용하면 모델 속성의 상태 변화에 추가적으로 대응할 수도 있습
니다.
8.7.6
뷰모델
vs
모델
MVVM
에서 뷰모델은 모델에 대해 전적인 책임을 지지만, 이 관계에는 고려해야 할 몇 가지
중요한 점이 있습니다. 뷰모델은 데이터 바인딩을 위해 모델 또는 모델의 속성을 가져올 수
있고, 뷰에 제공되는 속성을 가져오거나 조작하기 위한 인터페이스를 포함할 수 있습니다.
8.8
장단점
이제
MVVM
이 무엇이고, 어떻게 작동하는지에 대해 잘 이해하고 있을 것입니다. 다음은 이
패턴을 사용함에 따르는 장단점을 살펴보겠습니다.
8.8.1
장점
■
MVVM
은
UI
와 이를 구동하게 해주는 요소를 동시에 개발할 수 있도록 합니다.
■
MVVM
은 뷰를 추상화함으로써 뷰의 뒤에 작성되는 비즈니스 로직 (또는 연결 코드 )의 양을 줄여줍니다.
■ 뷰모델은 이벤트 중심 코드에 비해 단위 테스트가 더 쉽습니다.
■ 뷰모델은 (뷰보다는 모델에 가까우므로 )
UI
자동화나 상호작용에 대한
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