© 2023 Hashnode
#singleton-design-pattern
What is Creational Design Pattern? It is a unique way of object creation, making it easier for developers to create objects in a flexible and maintainable way, without tightly coupling their code to t…
Design patterns are a fundamental aspect of software development, providing a common vocabulary and structure for solving common problems. Understanding and effectively utilizing design patterns can g…
Introduction The singleton pattern is a type of creational pattern that restricts the instantiation of a class to a single object. This allows the class to create an instance of the class the first t…
What is Singleton Class? While doing projects, we sometimes want to keep only one instance of a class and don't want to pass the instance of an object by argument in each function. class ClassA { …
When I was starting to learn Go, I was passing around the instance to access the property of that instance. This is how I do it: e := echo.New() db := config.Db{}.Init() tools.Migrate(db) tools.InitR…
Introduction The singleton pattern is one of the simplest design patterns.The singleton pattern is a design pattern that restricts the instantiation of a class to one object. Singleton is a creational…
The Singleton Design Pattern Context I've recently been refactoring some of the major components of a project I've been working on for the last few years, Proxima. It's a tool to encode proxies in par…
Today I am going to explain about the simplest design pattern in this series. This is called Singleton Design Pattern. Without further ado lets jump in, shall we? Before starting, I hope you have enjo…
Introduction Before diving deep into the actual topic, it’s really important to make yourself familiar with the terminologies below. What are Design patterns ? In software engineering design patterns…