Design Patterns in Golang

Builder Pattern

This pattern allows you to create complex objects step by step, we deconstruct the object into several parts, reducing its constructor args and making it easier to understand how the object is built

Factory Pattern

This pattern provides an interface and allows you to modify the implementations of that interface according to the object that was created

Singleton Pattern

This pattern creates a single instance of a class/object and allows the entire application to modify it (it's a single instance that is consumed in multiple places)

Proxy Pattern

This pattern allows you to intercept the call between one function and another, like a middleware that will do a validation or addition on that call.

Decorator Pattern

This pattern allows you to group objects in such a way that the end result is unique result representing all "stacked" objects

Adapter Pattern

This pattern allows you to adapt one object that follows "x" interface into a object that follows a "y" interface.

Strategy Pattern

This pattern allows different implementatations of one specific strategy (that has a common interface to those who implement)

Chain Of Responsability Pattern

This pattern allow you to link different methods into a "chain" then one method will call each other in sequence