Moya 문서

[한글 번역] Moya Readme.md / 개요 (1)

초가을우엉차 2022. 6. 8. 00:49

Moya

 

1. You're a smart developer.

 ▶  당신은 똑똑한 개발자입니다. 

 

 

2. You probably use Alamofire to abstract away access to URLSession and all those nasty details you don't really care about.

 ▶  당신은 아마 Alamofire를 사용하여, URLSession에 대한 액세스와 별로 신경 쓰지 않는 모든 불쾌한 세부 정보를 추상화할 수 있습니다.

 

 

3. But then, like lots of smart developers, you write ad hoc network abstraction layers.

 ▶  그러나 많은 똑똑한 개발자와 마찬가지로, 당신은 임시 네트워크 추상화 계층을 작성합니다.

 

 

4. They are probably called "APIManager" or "NetworkModel", and they always end in tears.

 ▶ 이것들을 "APIManager" 또는 "NetworkModel"이라고 하며 항상 눈물로 끝납니다.

 

4. Ad hoc network layers are common in iOS apps. They're bad for a few reasons:

  • Makes it hard to write new apps ("where do I begin?")
  • Makes it hard to maintain existing apps ("oh my god, this mess...")
  • Makes it hard to write unit tests ("how do I do this again?")

 ▶ Ad Hoc 네트워크 계층은 iOS 앱에서 일반적입니다. 다음과 같은 몇 가지 이유로 좋지 않습니다. 

  • 새 앱을 작성하기 어렵게 만듭니다("어디서부터 시작해야 하나요?") 
  • 기존 앱을 유지 관리하기 어렵게 만듭니다("맙소사, 이 엉망...")
  •  단위 테스트를 작성하기 어렵게 만듭니다("이 작업을 다시 수행하려면 어떻게 해야 하나요?").

 

 

5. So the basic idea of Moya is that we want some network abstraction layer that sufficiently encapsulates actually calling Alamofire directly.

 ▶ 따라서 Moya의 기본 아이디어는 실제로 Alamofire를 직접 호출하는 것을 충분히 캡슐화하는 일부 네트워크 추상화 계층이 필요하다는 것입니다.

 

 

6. It should be simple enough that common things are easy, but comprehensive enough that complicated things are also easy.

 ▶ 일반적인 것은 쉬울 정도로 단순해야 하지만, 복잡한 것도 쉽게 할 수 있을 만큼 포괄적이어야 합니다.

 

If you use Alamofire to abstract away URLSession, why not use something to abstract away the nitty gritty of URLs, parameters, etc?
 ▶ Alamofire를 사용하여 URLSession을 추상화하는 경우, URL, 매개변수 등의 핵심을 추상화하는 데 사용하지 않겠습니까?

 

7. Some awesome features of Moya:

  • Compile-time checking for correct API endpoint accesses.
  • Lets you define a clear usage of different endpoints with associated enum values.
  • Treats test stubs as first-class citizens so unit testing is super-easy.

 ▶ Moya의 몇 가지 멋진 기능: 

  • 올바른 API 엔드포인트 액세스를 위한 컴파일 타임 검사
  • 연결된 열거형 값이 있는 다른 엔드포인트의 명확한 사용법을 정의 가능
  • 테스트 스텁을 일급 시민으로 취급하므로 단위 테스트가 매우 쉬움

 

 

8. You can check out more about the project direction in the vision document.

 ▶ 비전 문서에서 프로젝트 방향에 대해 자세히 확인할 수 있습니다.

 


출처

 

GitHub - Moya/Moya: Network abstraction layer written in Swift.

Network abstraction layer written in Swift. Contribute to Moya/Moya development by creating an account on GitHub.

github.com