Skip to Content
파이썬으로 살펴보는 아키텍처 패턴
book

파이썬으로 살펴보는 아키텍처 패턴

by 오현석, 해리 퍼시벌, 밥 그레고리
June 2021
Beginner to intermediate
356 pages
8h 13m
Korean
Hanbit Media, Inc.
Content preview from 파이썬으로 살펴보는 아키텍처 패턴
327
부록
C
인프라 교체: CSV로 모든 데이터 처리하기
C.1
CSV
를 사용한 저장소와 작업 단위 구현하기
여기서
CSV
기반 저장소 모습을 보여준다. 이 저장소는 디스크에서
CSV
를 읽는 과정이나
로 다른 두 가지
CSV
two
different
CSV
(하나는 배치, 하나는 할당 )를 읽어야 하는 내용을 추상화해
생략하고, 익숙한
list
()
API
만 제공한다. 이렇게 하면 도메인 객체를 메모리에 담은 컬렉션
을 제공하는 듯한 환상을 제공할 수 있다.
CSV
를 저장 메커니즘으로 사용하는 저장소(
src
/
allocation
/
service
_
layer
/
csv
_
uow
.
py
)
class CsvRepository(repository.AbstractRepository):
def __init__(self, folder):
self._batches_path = Path(folder) / ‘batches.csv’
self._allocations_path = Path(folder) / ‘allocations.csv’
self._batches = {} # type: Dict[str, model.Batch]
self._load()
def get(self, reference):
return self._batches.get(reference)
def add(self, batch): ...
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

효율적인 리눅스 명령어 사용의 기술

효율적인 리눅스 명령어 사용의 기술

Daniel J Barrett
쿠버네티스를 활용한 클라우드 네이티브 데브옵스

쿠버네티스를 활용한 클라우드 네이티브 데브옵스

최경현, 저스틴 도밍거스, 존 어런들

Publisher Resources

ISBN: 9791162244319