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

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

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
119
Chapter 07_
자바스크립트 디자인 패턴
// 출력:
// drive sideways
7.12.1
장점과 단점
믹스인은 함수의 중복을 줄이고 재사용성을 높입니다. 애플리케이션에서 객체 인스턴스 사
이에 공유되는 기능이 있다면 믹스인을 통해 기능을 공유하여 중복을 피하고 고유 기능을 구
현하는 데에 집중할 수 있습니다.
단, 믹스인의 단점은 아직 논쟁의 여지가 남아 있습니다. 몇몇의 개발자들은 클래스나 객체
의 프로토타입에 기능을 주입하는 것을 나쁜 방법이라고 여깁니다. 프로토타입 오염과 함수
의 출처에 대한 불확실성을 초래하기 때문입니다. 어쩌면 실제 대규모 시스템에서는 그럴지
도 모릅니다.
리액트에서도
ES6
클래스의 도입 이전
11
에는 컴포넌트에 기능을 추가하기 위해 믹스인을 사
용하곤 했습니다. 그러나 리액트 개발 팀은 컴포넌트의 유지보수와 재사용을 복잡하게 만든
다는 이유로 믹스인을 반대
12
했습니다. 그 대신 고차 컴포넌트나
Hooks
의 사용을 장려
13
했
습니다.
저는 문서화를 잘해두면 믹스인된 함수의 출처에 대한 혼란을 최소화할 수 있다고 생각합니
다. 모든 패턴이 그렇듯, 구현 과정에서 주의를 기울인다면 괜찮을 겁니다.
7.13
데코레이터 패턴
데코레이터
Decorator
패턴은 코드 재사용을 목표로 하는 구조 패턴입니다. 믹스인과 마찬가지
11
옮긴이_ ...
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