Design Patterns in Go
4.7 (53 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
660 students enrolled

Design Patterns in Go

Discover the modern implementation of design patterns in Go (golang)
Highest Rated
4.7 (53 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
660 students enrolled
Created by Dmitri Nesteruk
Last updated 12/2019
English
English [Auto-generated]
Current price: $69.99 Original price: $99.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 10 hours on-demand video
  • 51 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Recognize and apply design patterns
  • Refactor existing designs to use design patterns
  • Reason about applicability and usability of design patterns
Course content
Expand all 110 lectures 09:45:47
+ SOLID Design Principles
7 lectures 01:08:54

An overview of the SOLID design principles.

Overview
01:16

A look at the Single Responsibility Principle that states that a type (package) should have a single primary responsibility. Also discussed principles of Separation of Concerns and the God Object antipattern.

Single Responsibility Principle
12:17

A look at the Open-Closed Principle that states that types should be open for extension, but closed for modification.

Open-Closed Principle
19:06

This principle is not particularly applicable to Go, but you can still make it work... sort of.

Liskov Substitution Principle
10:10

The Interface Segregation Principle is simple: don't put too much into your interfaces.

Interface Segregation Principle
08:29

The Dependency Inversion Principle is a rather convoluted way of saying that you should depend on abstractions rather than implementation details.

Dependency Inversion Principle
15:00

A summary of the things we've learned about the SOLID design principles.

Summary
02:36
+ Builder
6 lectures 38:04

An overview of the Builder design pattern.

Overview
01:42

Here we look at the builtin strings.Builder and construct our own HtmlBuilder.

Builder
12:52

Sometimes you need several builders to build up an object.

Builder Facets
10:13

A look at how to coerce your users to use a Builder.

Builder Parameter
06:54

An alternative approach to implementing a Builder.

Functional Builder
05:10

A summary of the things we've learned about the Builder design pattern.

Summary
01:13
+ Factories
6 lectures 25:36

An overview of the Factory design pattern.

Overview
02:49

Go doesn't have constructors, but factory functions are a close equivalent.

Factory Function
03:27

A factory function that yields an interface rather than a concrete struct.

Interface Factory
04:54

Manufacturing preconfigured libraries and storing them as variables. Can be done with a functional approach (function returning function) or a structural approach.

Factory Generator
09:37

A generalized factory that can produce prepackaged objects.

Prototype Factory
03:53

A summary of the things we've learned about the Factory design patterns.

Summary
00:56
+ Prototype
6 lectures 26:10

An overview of the Prototype design pattern.

Overview
01:51

To implement Prototype, we need to master deep copying.

Deep Copying
05:36

One approach to deep copying is to give your structs a method called DeepCopy().

Copy Method
05:30

Serialization makes deep copying easy!

Copy Through Serialization
05:38

Factory functions tailored to different prototypes make the Prototype pattern easy to use!

Prototype Factory
07:04

A summary of the things we've learned about the Prototype design pattern.

Summary
00:31
+ Singleton
5 lectures 20:13

An overview of the much-maligned Singleton design pattern.

Overview
02:55

We implement a lazy, thread-safe singleton.

Singleton
05:56

Direct dependencies on singletons are painful because they violate DIP and ruin testability.

Problems with Singleton
04:21

Let's introduce abstractions and make our singleton more usable.

Singleton and Dependency Inversion
05:30

A summary of the Singleton design pattern. That wasn't so scary, was it?

Summary
01:31
+ Adapter
4 lectures 23:16

An overview of the Adapter design pattern.

Overview
01:57

A real-life example of an adapter.

Adapter
13:30

Adapters can generate temporary data so here's how to avoid it.

Adapter Caching
07:02

A summary of the Adapter design pattern.

Summary
00:47
+ Bridge
3 lectures 11:15

An overview of the Bridge design pattern.

Overview
02:21

Let's implement the Bridge design pattern!

Bridge
08:05

A summary of the things we've learned about the Bridge design pattern.

Summary
00:49
+ Composite
4 lectures 17:07

An overview of the Composite design pattern.

Overview
01:25

A demo of how the Composite pattern can be useful in a drawing application.

Geometric Shapes
06:51

An implementation of Composite with neural networks.

Preview 08:06

A summary of the Composite design pattern.

Summary
00:45
+ Decorator
4 lectures 22:27

An overview of the Decorator design pattern.

Overview
01:50

There's no 'multiple inheritance' in Go and multiple aggregation doesn't work that well, either.

Multiple Aggregation
09:09

A look at how to implement the Decorator pattern.

Decorator
10:30

A summary of the Decorator design pattern.

Summary
00:58
Requirements
  • Good understanding of Go
  • Familiarity with latest Go language features
  • Good understanding of software design principles
  • A computer with latest Go compiler and (hopefully) an IDE
Description

Course Overview

This course provides a comprehensive overview of Design Patterns in Go from a practical perspective. This course in particular covers patterns with the use of:

  • The latest versions of the Go programming language

  • Use of modern programming libraries and frameworks

  • Use of modern developer tools such as JetBrains GoLand

  • Discussions of pattern variations and alternative approaches

This course provides an overview of all the Gang of Four (GoF) design patterns as outlined in their seminal book, together with modern-day variations, adjustments, discussions of intrinsic use of patterns in the language.

What are Design Patterns?

Design Patterns are reusable solutions to common programming problems. They were popularized with the 1994 book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, John Vlissides, Ralph Johnson and Richard Helm (who are commonly known as a Gang of Four, hence the GoF acronym).

The original book GoF book used C++ and Smalltalk for its examples, but, since then, design patterns have been adapted to every programming language imaginable: C#, Java, Swift, Python, JavaScript and now — Go!

The appeal of design patterns is immortal: we see them in libraries, some of them are intrinsic in programming languages, and you probably use them on a daily basis even if you don't realize they are there.

What Patterns Does This Course Cover?

This course covers all the GoF design patterns. In fact, here's the full list of what is covered:

  • SOLID Design Principles: Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion Principle

  • Creational Design Patterns: Builder, Factories (Factory Method and Abstract Factory), Prototype and Singleton

  • Structrural Design Patterns: Adapter, Bridge, Composite, Decorator, Façade, Flyweight and Proxy

  • Behavioral Design Patterns: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method and Visitor

Who Is the Course For?

This course is for Go developers who want to see not just textbook examples of design patterns, but also the different variations and tricks that can be applied to implement design patterns in a modern way. For example, the use of the Composite pattern allows structures to be iterable and lets scalar objects masquerade as if they were collections.

Presentation Style

This course is presented as a (very large) series of live demonstrations being done in JetBrains GoLand and presented using the Kinetica rendering engine. Kinetica removes the visual clutter of the IDE, making you focus on code, which is rendered perfectly, whether you are watching the course on a big screen or a mobile phone. 

Most demos are single-file, so you can download the file attached to the lesson and run it in GoLand, or another IDE of your choice (or just run them from the command-line).

This course does not use UML class diagrams; all of demos are done via live coding.

Who this course is for:
  • Software engineers
  • Web developers
  • Designers
  • Architects