72 0

옵저버 패턴에서 Kotlin 흐름 API의 도출

Title
옵저버 패턴에서 Kotlin 흐름 API의 도출
Other Titles
Derivation of Kotlin Flow API from Observer Pattern
Author
김정선
Keywords
코틀린 흐름; 코루틴; 설계 패턴; 리액티브 스트림; Kotlin flow; Kotlin coroutine; design pattern; reactive stream
Issue Date
2023-09
Publisher
한국정보과학회
Citation
정보과학회논문지, v. 50, NO. 9, Page. 821.0-826.0
Abstract
Kotlin 흐름은 비동기식 리액티브 스트림 데이터 처리를 위해 Kotlin 코루틴의 중단 함수를 기반으로 개발된 라이브러리이다. 그동안 널리 사용되어 왔던 무거운 라이브러리인 RxJava와는 달리 Kotlin 흐름은 코루틴의 중단 함수를 통해 자연스런 역압력 기능을 제공하기 때문에 최근 들어 리액티브 응용프로그램 개발 시 그 활용도가 높아지고 있다. 그럼에도 불구하고, 프로그래머는 흐름 API의 동작을 이해하는 데 어려움을 겪고 있는데, 이는 리액티브한 흐름 API의 동작이 일반적 API에 비해 익숙하지 않기 때문일 수도 있지만 흐름 API가 옵저버 패턴을 기본으로 하고 있다는 사실을 인지하지 못하고 있는 점 또한 주요 원인이라고 할 수 있다. 본 논문에서는 옵저버 패턴으로부터 흐름 API가 도출되는 과정을 단계별로 제시함으로써 Kotlin 흐름 API가 옵저버 패턴과 Kotlin 코루틴에 기초하여 정의되었으며, 이를 기반으로 리액티브 스트림 기능을 제공하고 있음을 보여준다.;Kotlin Flow is an asynchronous reactive stream library developed on top of Kotlin coroutine’s suspending functions. Recently, many reactive applications have increasingly adopted the Kotlin Flow instead of the well-known, but nevertheless heavy-weight, RxJava because it provides back-pressure support naturally by using coroutine’s suspending functions. However, the workings of the Flow API are difficult for most programmers to understand. One of the main reasons is due to the ignorance of the fact that its API is originated from the Observer Pattern, as well as its inherent reactive nature. In this paper, we show that Kotlin Flow API is nothing but a reactive version of the adapted Observer Pattern, together with Kotlin coroutines, by step-by-step illumination of how its API is derived from both the Observer Pattern and Kotlin’s coroutine.
URI
https://www.dbpia.co.kr/journal/articleDetail?nodeId=NODE11519764https://repository.hanyang.ac.kr/handle/20.500.11754/187744
ISSN
2383-630X;2383-6296
DOI
10.5626/JOK.2023.50.9.821
Appears in Collections:
ETC[S] > ETC
Files in This Item:
There are no files associated with this item.
Export
RIS (EndNote)
XLS (Excel)
XML


qrcode

Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.

BROWSE