Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔀 :: 프로젝트 전체 리팩토링 #2

Merged
merged 6 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions ADR/서브_패키지_지원방식.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---

title: 서브 패키지 지원 방식
date: 2023-05-30

---

# ConcurrencyNeiSwift, CombineNeiSwift같은 서브 패키지에서 NeiSwift 패키지에 정의된 API를 지원 하는 방식

## Context

CombineNeisProtocol과 같은 protocol을 만들고 API가 AnyPublisher를 return하도록 하고, NeiSwift 패키지의 Neis 구조체가 CombineNeisProtocol을 채택하도록 작성
vs
NeiSwift 패키지의 NeisProtocol을 확장하여 그 안에 AnyPublisher를 리턴하는 확장함수 작성

## Decision

CombineNeisProtocol, AsyncNeisProtocol을 만들어 Neis 구조체가 채택하도록 작성

### Why

NeisProtocol에 extension 으로 추가할 시 간편하게 확장할 수 있지만,
POP 관점에서 protocol과 protocol을 조합해서 만드는 것이 이상적이라 생각하여 전자의 방식을 택.

## Consequences

### Benefit

- POP적인 코드
- 필요에 따라 AsyncNeisProtocol, CombineNeisProtocol만 구현해 따로 주입이 가능

### Concern

- 코드가 2배?!

This file was deleted.

This file was deleted.

This file was deleted.

Loading