Introduction to Go Classical Patterns
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.
About The Author
Mario Castro Contreras is a software engineer who has specialized in distributed systems and big data solutions. He works as a site reliability engineer, and now he is focused on containerized solutions and apps using most of the Google Cloud suite, especially Kubernetes. He has wide experience in systems and solutions integration, and he has written many scalable and reliable 12-factor apps using Go and Docker. He has designed big data architectures for financial services and media, and he has written data processing pipelines using event-driven architectures written purely in Go. He is also very active in the open source community, and you can find him on his GitHub account with the username sayden. In the past, he has also written mobile applications and backends in Java.
Mario is passionate about
programming languages, and he found the best balance between fun and
productivity in Go; however, recently, he enjoys writing in Rust and
embedded systems in C. He is also passionate about road cycling and
The most important task to do when starting with a new programming language is to set the work environment. This video will show you how to do this for Go.
This video will show you how to write your first program in Go and walk you through some basic data types in Go language.
The basic logic for good programs are conditional statements. Let’s get started with the most used conditional statements with this video.
In Go, whatever you design is used through functions. Let’s see how functions work and are used in Go.
This video will show you how data structures are manipulated and used in Go.
The next step, after exploring functions and data structures, is to learn about the most useful elements of Go, which are pointers, structures and interfaces. Let’s jump right in to start with these.
When you write a small piece of code, it is easy to spot bugs. But what if the program or application grows bigger and bigger? Let’s see how you could write unit tests to spot errors and catch bugs.
Until now, you have learned to develop codes for applications. How can you create libraries which are not applications or which do not contain the main function? This video is an answer to this question.
Go comes with a series of useful tools to ease the development process every day. Let’s explore these amazing tools with this video.
How can you have a unique instance of a type in the entire program? Singleton design pattern is the way to achieve this. Let’s learn about this pattern.
How can you construct complex objects without directly instantiating their struct or writing the logic they require? Let’s do this with the builder design pattern.
How can we abstract the user from the knowledge of the struct he needs to achieve for a specific purpose, such as retrieving some value, maybe from a web service or a database? This video will help you answer this question.
After learning about the factory design pattern, where we grouped a family of related objects in our case payment methods, one can be quick to think: what if I group families of objects in a more structured hierarchy of families? This video will answer your question.
Let’s see the last pattern with this video, which comes in handy when creating objects and is commonly surrounded by more patterns.
This video will walk you through the different approaches to create hierarchies and trees of objects using the composite design pattern.
How can you use something that wasn't built for a specific task at the beginning? Let’s answer this question with the adapter design pattern.
Let’s learn to decouple abstraction from its implementation and change what an object does as much as we want. This video will show you how you can change the abstracted object while reusing the same implementation.
More on Structural Patterns
Let’s dive into the Proxy design pattern; it provides interesting features and possibilities with very little effort.
This video will walk you through the methods and practices to provide a lot of benefits when working with legacy code.
This video will show you how you can hide the rooms and corridors of a building. By the end of this video, you will be able to shield the code from unwanted access, order some calls, and hide the complexity scope from the user.
This video will show you how to allow sharing the state of a heavy object between many instances of some type. You will explore a very commonly used design pattern, in computer graphics and the video game industry.