The Code Nomad

The Code Nomad

Design Patterns in Go: Strategy

Introduction The strategy pattern is a behavorial design pattern that allows you to define a family of algorithms, encapsulate them as an object, and with the help of interfaces make them interchangeable. What does it look like? A short explanation:…

Design Patterns in Go: Observer

Introduction The observer pattern is a software design pattern that allows an object, usually called the subject, to maintain a list of dependents, called observers, and notify them automatically of any state-changes. Many languages have this pattern either built-in or…