Go Design Patterns

Learn idiomatic, efficient, clean, and extensible Go design and concurrency patterns by using TDD
Preview in Mapt

Go Design Patterns

Mario Castro Contreras

Learn idiomatic, efficient, clean, and extensible Go design and concurrency patterns by using TDD
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Go Design Patterns Book Cover
Go Design Patterns
$ 39.99
$ 28.00
Go: Design Patterns for Real-World Projects Book Cover
Go: Design Patterns for Real-World Projects
$ 71.99
$ 50.40
Buy 2 for $35.00
Save $76.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781786466204
Paperback402 pages

Book Description

Go is a multi-paradigm programming language that has built-in facilities to create concurrent applications. Design patterns allow developers to efficiently address common problems faced during developing applications.

Go Design Patterns will provide readers with a reference point to software design patterns and CSP concurrency design patterns to help them build applications in a more idiomatic, robust, and convenient way in Go.

The book starts with a brief introduction to Go programming essentials and quickly moves on to explain the idea behind the creation of design patterns and how they appeared in the 90’s as a common "language" between developers to solve common tasks in object-oriented programming languages. You will then learn how to apply the 23 Gang of Four (GoF) design patterns in Go and also learn about CSP concurrency patterns, the "killer feature" in Go that has helped Google develop software to maintain thousands of servers.

With all of this the book will enable you to understand and apply design patterns in an idiomatic way that will produce concise, readable, and maintainable software.

Table of Contents

Chapter 1: Ready... Steady... Go!
A little bit of history
Installing Go
Starting with Hello World
Integrated Development Environment - IDE
Types
Variables and constants
Operators
Flow control
Functions
Arrays, slices, and maps
Visibility
Zero-initialization
Pointers and structures
Interfaces
Testing and TDD
Libraries
The Go get tool
Managing JSON data
Go tools
Contributing to Go open source projects in GitHub
Summary
Chapter 2: Creational Patterns - Singleton, Builder, Factory, Prototype, and Abstract Factory Design Patterns
Singleton design pattern - having a unique instance of a type in the entire program
Builder design pattern - reusing an algorithm to create many implementations of an interface
Factory method - delegating the creation of different types of payments
Abstract Factory - a factory of factories
Prototype design pattern
Summary
Chapter 3: Structural Patterns - Composite, Adapter, and Bridge Design Patterns
Composite design pattern
Adapter design pattern
Bridge design pattern
Summary
Chapter 4: Structural Patterns - Proxy, Facade, Decorator, and Flyweight Design Patterns
Proxy design pattern
Decorator design pattern
Facade design pattern
Flyweight design pattern
Summary
Chapter 5: Behavioral Patterns - Strategy, Chain of Responsibility, and Command Design Patterns
Strategy design pattern
Chain of responsibility design pattern
Command design pattern
Summary
Chapter 6: Behavioral Patterns - Template, Memento, and Interpreter Design Patterns
Template design pattern
Memento design pattern
Interpreter design pattern
Summary
Chapter 7: Behavioral Patterns - Visitor, State, Mediator, and Observer Design Patterns
Visitor design pattern
State design pattern
Mediator design pattern
Observer design pattern
Chapter 8: Introduction to Gos Concurrency
A little bit of history and theory
Goroutines
Callbacks
Mutexes
Channels
Using it all - concurrent singleton
Summary
Chapter 9: Concurrency Patterns - Barrier, Future, and Pipeline Design Patterns
Barrier concurrency pattern
Future design pattern
Pipeline design pattern
Summary
Chapter 10: Concurrency Patterns - Workers Pool and Publish/Subscriber Design Patterns
Workers pool
Concurrent Publish/Subscriber design pattern
Summary

What You Will Learn

  • All basic syntax and tools needed to start coding in Go
  • Encapsulate the creation of complex objects in an idiomatic way in Go
  • Create unique instances that cannot be duplicated within a program
  • Understand the importance of object encapsulation to provide clarity and maintainability
  • Prepare cost-effective actions so that different parts of the program aren't affected by expensive tasks
  • Deal with channels and GoRoutines within the Go context to build concurrent application in Go in an idiomatic way

Authors

Table of Contents

Chapter 1: Ready... Steady... Go!
A little bit of history
Installing Go
Starting with Hello World
Integrated Development Environment - IDE
Types
Variables and constants
Operators
Flow control
Functions
Arrays, slices, and maps
Visibility
Zero-initialization
Pointers and structures
Interfaces
Testing and TDD
Libraries
The Go get tool
Managing JSON data
Go tools
Contributing to Go open source projects in GitHub
Summary
Chapter 2: Creational Patterns - Singleton, Builder, Factory, Prototype, and Abstract Factory Design Patterns
Singleton design pattern - having a unique instance of a type in the entire program
Builder design pattern - reusing an algorithm to create many implementations of an interface
Factory method - delegating the creation of different types of payments
Abstract Factory - a factory of factories
Prototype design pattern
Summary
Chapter 3: Structural Patterns - Composite, Adapter, and Bridge Design Patterns
Composite design pattern
Adapter design pattern
Bridge design pattern
Summary
Chapter 4: Structural Patterns - Proxy, Facade, Decorator, and Flyweight Design Patterns
Proxy design pattern
Decorator design pattern
Facade design pattern
Flyweight design pattern
Summary
Chapter 5: Behavioral Patterns - Strategy, Chain of Responsibility, and Command Design Patterns
Strategy design pattern
Chain of responsibility design pattern
Command design pattern
Summary
Chapter 6: Behavioral Patterns - Template, Memento, and Interpreter Design Patterns
Template design pattern
Memento design pattern
Interpreter design pattern
Summary
Chapter 7: Behavioral Patterns - Visitor, State, Mediator, and Observer Design Patterns
Visitor design pattern
State design pattern
Mediator design pattern
Observer design pattern
Chapter 8: Introduction to Gos Concurrency
A little bit of history and theory
Goroutines
Callbacks
Mutexes
Channels
Using it all - concurrent singleton
Summary
Chapter 9: Concurrency Patterns - Barrier, Future, and Pipeline Design Patterns
Barrier concurrency pattern
Future design pattern
Pipeline design pattern
Summary
Chapter 10: Concurrency Patterns - Workers Pool and Publish/Subscriber Design Patterns
Workers pool
Concurrent Publish/Subscriber design pattern
Summary

Book Details

ISBN 139781786466204
Paperback402 pages
Read More

Read More Reviews

Recommended for You

Mastering Concurrency in Go Book Cover
Mastering Concurrency in Go
$ 30.99
$ 21.70
Go Programming Blueprints Book Cover
Go Programming Blueprints
$ 29.99
$ 21.00
Mastering Go Web Services Book Cover
Mastering Go Web Services
$ 39.99
$ 28.00
Learning Go Web Development Book Cover
Learning Go Web Development
$ 23.99
$ 16.80
Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Advanced Continuous Delivery Pipeline [Video] Book Cover
Advanced Continuous Delivery Pipeline [Video]
$ 124.99
$ 106.25