Structural Patterns
Patterns for composing types and boundaries in Go with interfaces, embedding, adapters, and focused packages.
7 published articles in this category
Adapter in Go
Wrap an incompatible API behind the interface your application already expects so the rest of the code stays unchanged.
Bridge in Go
Separate an abstraction from its implementation so both sides can vary independently without multiplying concrete types.
Composite in Go
Treat individual objects and object groups uniformly so recursive tree structures stay simple to traverse and aggregate.
Decorator in Go
Add behavior around an object dynamically by wrapping it with small focused layers that share the same interface.
Facade in Go
Provide one simplified entry point over several collaborating subsystems so callers can trigger a workflow without knowing every step.
Flyweight in Go
Share intrinsic immutable state across many small objects so large collections stay cheaper in memory and easier to manage.
Proxy in Go
Control access to another object by standing in front of it to add caching, authorization, rate limiting, or lazy loading.