Hi friends! With you, Alex and I continue our series of articles on the use of design patterns in the Golang language.

It is interesting to receive feedback from you, to understand how applicable this area of ​​knowledge is in the world of the Golang language. We have already looked at patterns: Simple Factory, Singleton, and Strategy. Today I want to consider another design pattern — Prototype.

What is it needed for?

It is a creating design pattern that allows objects to be copied without going into the details of their implementation.

What problem does it solve?

Imagine you have an object that needs to be copied. How to do…


Hi friends. Alex Versus with you.

Earlier we talked about the Singleton and Strategy design patterns, about the subtleties of implementation in the Golang language. Today I will tell you about the Factory method.

What’s the point?

The Factory method, also known as the Virtual Constructor, is an astounding design pattern that defines a common interface for creating objects in a parent class and allows you to modify the created objects in child classes.

The pattern allows a class to delegate object creation to subclasses. Used when:

  1. The class does not know in advance what subclasses it needs to create.
  2. Responsibilities are delegated…


Hi friends. My name is Alex Versus and today we will take a look at the Singleton pattern, an implementation in the Golang language.

What’s the point?

Singleton — refers to creational patterns. Ensures that:

  • a class / type has only one instance
  • and provides a global access point to it.

What problem does it solve?

Let’s talk about the problem that the pattern solves. A loner solves two problems at once, violating the Single Responsibility Principle (SRP):

  1. Ensures that there is a single instance of an object. This is useful for accessing a shared resource, such as a database, or when implementing a single mechanism for changing…


Hello everyone, friends. My name is Alex and I am a professional software developer and creator in the web industry. I have been studying languages ​​for many years, sharing my experience with others.

Today I want to talk to you about the Strategy design pattern. I will try to convey to you the principles and essence of the template without water, and show you how to apply it in practice.

What’s the point?

Design patter Strategy refers to behavioral design patterns. It’s task is to identify similar algorithms that solve a specific problem. …

Alex Versus

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store