Hands-On Dependency Injection in Go: Produce clean and loosely coupled Go code that is easier to read, maintain, test and extend
暫譯: Go 語言中的依賴注入實務:產出乾淨且鬆耦合的 Go 代碼,提升可讀性、可維護性、可測試性與可擴展性

Corey Scott

  • 出版商: Packt Publishing
  • 出版日期: 2018-11-28
  • 售價: $1,380
  • 貴賓價: 9.5$1,311
  • 語言: 英文
  • 頁數: 346
  • 裝訂: Paperback
  • ISBN: 1789132762
  • ISBN-13: 9781789132762
  • 相關分類: Go 程式語言
  • 立即出貨 (庫存=1)

買這商品的人也買了...

相關主題

商品描述

Dependency Injection in Go, often considered to be tedious, made easy with this comprehensive guide

Key Features

  • Gain an in-depth insight into Dependency Injection and the SOLID principles
  • Learn how to refactor existing code to adopt Dependency Injection using several of the methods available in Go.
  • Discover how to design a system from scratch to support Dependency Injection and also Dependency Injection anti-patterns.

Book Description

Go simplifies the process of building steadfast and well-organized software. Leverage Dependency Injection and Testings to produce clean, loosely coupled Go code that is inherently easier to read, maintain, test and extend.

Hands-On Dependency Injection and Testing in Go is an in-depth guide to Dependency Injection and the SOLID principles for Go. It will take you on a journey to refactor existing code to adopt Dependency Injection using several methods available in Go. Each method is explained in detail, focusing on their strengths and weakness and with the help of examples, and you will gain knowledge on how to best leverage the method to transform the code into something simple and flexible. Moving ahead, you will learn how to incorporate the dependency graph to spot and eliminate issues. The book will educate you on the techniques involved in using Dependency Injection with test stubs and mocks to test otherwise difficult or impossible scenarios and achieve thorough unit test coverage.

Finally, we will talk about how to design a system from scratch to support Dependency Injection and also Dependency Injection anti-patterns.

What you will learn

  • Understand the benefits of Dependency Injection.
  • Explore several Dependency Injection patterns in Go.
  • Learn to leverage Dependency Injection to produce high quality, loosely coupled and thoroughly tested Go code.
  • Gain insight on how to refactor existing Go code to use Dependency Injection.
  • Learn to design a Go new package or system to use Dependency Injection

Who This Book Is For

Programmers with a few years experience in any language and a basic understanding of Go who wish to produce clean, loosely coupled code.

商品描述(中文翻譯)

**在 Go 中的依賴注入,常被認為繁瑣,但這本全面的指南讓它變得簡單**

#### 主要特點

- 深入了解依賴注入及 SOLID 原則
- 學習如何重構現有代碼以採用依賴注入,使用 Go 中的多種方法
- 探索如何從零開始設計一個支持依賴注入的系統,以及依賴注入的反模式

#### 書籍描述

Go 簡化了構建穩定且組織良好的軟體的過程。利用依賴注入和測試來產生乾淨、低耦合的 Go 代碼,這使得代碼更易於閱讀、維護、測試和擴展。

《在 Go 中的實作依賴注入與測試》是一本深入探討 Go 的依賴注入及 SOLID 原則的指南。它將帶領你重構現有代碼,以採用 Go 中的多種方法。每種方法都詳細解釋,重點介紹其優缺點,並輔以範例,讓你了解如何最佳利用這些方法將代碼轉變為簡單且靈活的形式。接下來,你將學習如何整合依賴圖以發現並消除問題。本書將教你使用依賴注入與測試存根和模擬來測試那些難以或不可能測試的場景,並實現全面的單元測試覆蓋率。

最後,我們將討論如何從零開始設計一個支持依賴注入的系統,以及依賴注入的反模式。

#### 你將學到什麼

- 理解依賴注入的好處
- 探索 Go 中的幾種依賴注入模式
- 學習利用依賴注入來產生高品質、低耦合且經過充分測試的 Go 代碼
- 獲得如何重構現有 Go 代碼以使用依賴注入的見解
- 學習設計一個新的 Go 套件或系統以使用依賴注入

#### 本書適合誰

有幾年經驗的程式設計師,無論使用任何語言,並對 Go 有基本了解,希望產生乾淨、低耦合的代碼。