Skip to content

darkvard/go-design-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns in Go

Pattern Concepts

Category Concept
Creational These patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code.
Structural These patterns explain how to assemble objects and classes into larger structures while keeping these structures flexible and efficient.
Behavioral These patterns are concerned with algorithms and the assignment of responsibilities between objects.

Pattern List

Category Pattern Description
Creational Abstract Factory Provides an interface for creating families of related or dependent objects.
Builder Constructs complex objects step by step.
Factory Method Defines an interface for creating objects, but allows subclasses to alter the type of objects that will be created.
Option Function Uses function parameters to set configuration options.
Property Provides access to an object's properties in a controlled manner.
Singleton Ensures a class has only one instance and provides a global point of access to it.
Structural Adapter Converts one interface to another expected by the client.
Bridge Decouples an abstraction from its implementation so both can vary independently.
Composite Composes objects into tree-like structures to represent part-whole hierarchies.
Decorator Adds behavior to an object dynamically without altering its structure.
Facade Provides a simplified interface to a complex subsystem.
Flyweight Reduces memory usage by sharing common parts of an object.
Proxy Provides a surrogate or placeholder for another object.
Behavioral Chain of Responsibility Allows passing a request along a chain of handlers.
Command Encapsulates a request as an object, allowing for parameterization of clients.
Interpreter Defines a grammatical representation for a language and an interpreter.
Iterator Provides a way to access elements of a collection sequentially.
Mediator Centralizes communication between objects to reduce dependencies.
Memento Captures and restores an object's internal state without exposing it.
Observer Notifies dependent objects about changes in the state of an object.
State Allows an object to change its behavior when its internal state changes.
Strategy Defines a family of algorithms and makes them interchangeable.
Template Method Defines the structure of an algorithm, deferring specific steps to subclasses.
Visitor Allows you to add further operations to objects without modifying them.

About

Go design patterns: concepts, patterns, and practical usage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages