Go: Data Structures, Algorithms and Design Patterns with Go
- 10 hours on-demand video
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- This course is aimed at beginner-level developers in the Go programming language, who would like to learn data structures and algorithms in Golang.
This video introduces the course and gives a quick look at where you’ll be at the end of the course.
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.
Use and print the values from a pointer
Declare and use structures; at the end we will explore interfaces
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.
Implement a payments method Factory
Create an interface with the Pay method
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.
Reuse the Factory created in the Builder design pattern
Create a new Factory to create shipment orders
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.
Write to an io.Writer interface
Write two abstracted object users of the implementations
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.
Write your own library that accesses OpenWeatherMaps service
Write the Unit test and create the implementation
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.
Simulate things that you find on betting web pages
Store each team's information just once
Deliver references to them to the users
This video will show you how to encapsulate actions that don’t necessarily need to be executed immediately or must be stored.
Create a simple queue
Create many instances of a type implementing a command pattern
Pass these instances to a queue that will store the commands until three of them are in the queue
How could you provide a user some way to execute code within an algorithm? This video will let you answer this question. You will be able to write idiomatic Go Template patterns.
Write an algorithm that is composed of three steps
Make each step return a message
Let the first and third steps be controlled by the template, and the second by the user
This video will show you how you could save milestones of a state when you have a type with some state. You will learn to recover them if necessary for a variety of tasks: undo operations, historic, and so on.
Develop a simple example using a string as the state
Store a finite amount of states of type string
Restore the current stored state to one of the state list
You may require something that has one or more states and travels between them to execute some behaviors. These are termed as FSMs. Let's see how the State pattern helps us to define FSM.
Develop a very simple game that uses FSM
Create a type that alters its own behavior when some internal things have changed
Add more states and reroute their output states
How can you uncouple an event from its possible handler? How can you achieve many actions that are triggered on one event? Let’s answer these questions with this video.
Create a publisher with a NotifyObservers method
Create a method to add new subscribers to the publisher
Create a method to remove new subscribers from the publisher
This video gives you a quick glimpse of what all we will be exploring through this course.
If you are working with concurrent applications, you have to deal with more than oneresource potentially accessing some memory location. How do we deal with this condition? Let’s learn through this video.
Develop a small concurrent counter
Add 1 to an integer field in a Counter type
Make the detector of the -race flag warn of a possible race condition
This video will walk you through the usage of channels that allow you to write concurrent applications. You could share a memory location and get a natural way to handle concurrent applications.
Understand how channels work and learn to use them
Use buffered channels and directional channels
Use the select statement
It’s time put all our knowledge about Goroutines and channels in asingle package. Let’s do it right now with this video.
Create a concurrent counter
Use three channels, the first one to add 1
Use the second channel to get thecurrent count and the third to stop the Goroutine
- Prior knowledge of basic Go programming would be advantageous.
Go is a multi-paradigm programming language that has built-in facilities to create concurrent applications. 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.
With this hands-on, practical course, you'll first have a deep dive into understanding the basic data types, structures, linked lists and doubly linked lists in Go. Then, you will learn about graph algorithms such as binary & trees. You will then learn about CSP concurrency patterns used to maintain thousands of servers. Moving further, you will also gain advanced knowledge about classic design patterns to build concise, readable, and maintainable applications & software.
Finally, you will learn concurrent structures and parallel execution which helps you improve your concepts of Go Concurrency to write concurrent apps & develop some classical design patterns with concurrent structures to maximize parallelism.
Contents and Overview
This training program includes 2 complete courses, carefully chosen to give you the most comprehensive training possible.
The first course, Learning Go Data Structures, and Algorithms will begin by understanding the basic Data types and Structures in Go. Moving forward, you will learn the power of linked lists and doubly linked lists in Go and then learn to implement linear data structures such as stacks and queues. Also, implement binary searches and trees and will explore sorting algorithms in detail. From here, you will learn about graph algorithms and also be introduced to some common data structures used while working with strings. You will learn common techniques and structures used in tasks such as preprocessing, modelling, and transforming data. By the end of this course, you would have mastered functional and reactive implementations of traditional data structures in an easy and efficient manner
The second course, Introduction to Go Classical Patterns 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.
The third course, Go Behavioural Patterns will take you to an advanced level of knowledge about classic design patterns but, as you will see, the design patterns covered here are quite different, partly because of the lack of inheritance in Go, but also because we have different and more optimal ways to solve the same problems. With all this, the course will enable you to understand and apply design patterns in an idiomatic way that will produce concise, readable, and maintainable software.
The fourth course, Go Concurrency is on learning about concurrent structures and parallel execution. You will use the majority of Go primitives to write concurrent apps, and we will develop some classical design patterns with concurrent structures to maximize parallelism. Also, you will learn some typical structures with which to develop concurrent apps in Go. You will learn how a classical pattern can become more complex if you need it to work in a concurrent way; however, the idea is to understand Go concurrent primitives so that you know how to write your own concurrent design patterns by using the knowledge taken from the course.
About the Authors:
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 the media, and he has written data processing pipelines using event-driven architectures entirely 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 finds 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 winter sports.
- Understanding the basics to get started with Golang
- Implementing stacks and queues & data structure
- Exploring different concurrency models for data processing
- Build your own tiny distributed search engine
- 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
- Learn most Go primitives and write concurrent apps
- Develop some classical design patterns with concurrent structures to maximize parallelism