Behavioral Patterns

Patterns for organizing control flow, workflows, and collaboration with explicit errors, interfaces, and small units of behavior.

10 published articles in this category

Behavioral
Interactive

Chain of Responsibility in Go

Build validation and request-processing pipelines with small handlers composed through interfaces.

just now
Behavioral
Interactive

Command Pattern in Go

Encapsulate operations for queuing, audit history, and undo/redo while keeping Go error handling explicit.

just now
Behavioral
Interactive

Iterator in Go

Traverse a collection without exposing its internal representation, keeping traversal state separate from the aggregate.

just now
Behavioral
Interactive

Mediator in Go

Centralize communication between collaborating objects so they depend on a coordinator instead of referencing each other directly.

just now
Behavioral
Interactive

Memento in Go

Capture and restore object state without exposing internal details so undo and rollback remain explicit and controlled.

just now
Behavioral
Interactive

Observer in Go

Notify dependent subscribers when state changes so event-driven reactions stay decoupled from the publisher.

just now
Behavioral
Interactive

State in Go

Change an object’s behavior when its internal state changes by delegating transitions and rules to state-specific types.

just now
Behavioral
Interactive

Strategy in Go

Encapsulate interchangeable algorithms behind one interface so callers can swap behavior without branching on concrete rules.

just now
Behavioral
Interactive

Template Method in Go

Define the skeleton of an algorithm once while letting concrete steps vary through narrow hook methods.

just now
Behavioral
Interactive

Visitor in Go

Add operations across a stable object structure without changing each node type whenever a new operation is introduced.

just now