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

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

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
169
Chapter 07_
자바스크립트 디자인 패턴
const employeeDetail = this.getEmployeeDetail();
// 직원 정보 입력이 완료되면,
// 중재자('orgchart' 객체)가 다음 행동을 결정
employeeDetail.on('complete', employee => {
// 추가할 이벤트를 가진 객체를 추가하고,
// 중재자가 추가적인 작업을 하도록 설정
const managerSelector = this.selectManager(employee);
managerSelector.on('save', employee => {
employee.save();
});
});
},
// ...
};
과거에는 이런 종류의 객체를 ‘워크플로’ 객체라고 언급한 적이 많습니다. 하지만 사실 이게
바로 중재자 객체입니다. 이 중재자 객체는 여러 객체 간의 워크플로를 처리하며, 이를 통해
워크플로의 관리 책임을 단일 객체에 집중시킵니다. 그 결과 워크플로를 보다 쉽게 이해하고
유지할 수 있습니다.
7.19.2
유사점과 차이점
앞서 보여드린 중재자 패턴과 이벤트 집합 패턴의 예시에는 분명히 유사한 점이 있습니다.
유사점은 ‘이벤트’와 ‘서드 파티 객체’라는 두 가지 핵심 요소로 요약할 수 있습니다. 하지만
차이점은 어디까지나 표면적인 ...
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.
Start your free trial

You might also like

AI를 위한 필수 수학

AI를 위한 필수 수학

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

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

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

Publisher Resources

ISBN: 9791169212571