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

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

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
100
자바스크립트 + 리액트 디자인 패턴
싱글톤임을 파악하는 것이 힘들다
큰 모듈을 가져오는 경우, 어떤 클래스가 싱글톤 클래스인지 알아내기 어렵습니다. 그러
므로 싱글톤 클래스를 일반 클래스로 착각하여 여러 객체를 인스턴스화하거나 부적절한
방법으로 수정할 수도 있습니다.
테스트하기 힘들다
싱글톤은 숨겨진 의존성, 여러 인스턴스 생성의 어려움, 의존성 대체의 어려움 등 다양
한 문제로 테스트하기에 생각보다 더 어려울 수 있습니다.
신중한 조정이 필요하다
싱글톤의 일상적인 사용 사례로는 전역 범위에 걸쳐 필요한 데이터를 저장하는 것이 있
습니다. 예를 들어 한 번 설정되고 난 후에 여러 컴포넌트에서 사용할 수 있는 사용자 인
증 정보나 쿠키 등이 있습니다. 따라서 데이터가 유효하게 된 뒤에 사용할 수 있도록 올
바른 실행 순서를 구현하는 일은 필수적입니다. 하지만 애플리케이션의 크기와 복잡성
이 커짐에 따라 어려워질 수 있습니다.
7.5.1
리액트의 상태 관리
리액트를 통해 웹 개발을 한다면 싱글톤 대신
Context
API
나 리덕스
Redux
같은 전역 상태 관
리 도구를 이용하여 개발할 수도 있습니다. 싱글톤과는 달리, 이러한 전역 상태 관리 도구는
변경 불가능한 읽기 전용 상태를 제공합니다.
이러한 도구를 사용한다고 해서 전역 상태가 가지는 여러 단점을 손쉽게 처리할 ...
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