Patterns
The Patterns section captures repeatable, experience-backed ways of working with Plumego.
If Concepts explain how Plumego works,
and Architecture explains how systems should be shaped,
then Patterns explain how teams should actually write code day to day.
These are not theoretical patterns.
They are practical constraints designed to prevent slow architectural decay.
What Patterns Are For
Patterns exist to solve a specific problem:
Good architecture decisions tend to erode under day-to-day delivery pressure.
Patterns help by:
- Making “the right way” concrete
- Reducing ambiguity in reviews
- Preventing accidental framework leakage
- Keeping systems readable as they grow
They are guardrails, not rules engines.
What Patterns Are Not
Patterns are not:
- Mandatory framework features
- One-size-fits-all prescriptions
- Clever abstractions
- Library-specific tricks
If a pattern feels heavy or unnecessary,
it is probably being applied too early.
How to Use This Section
Patterns are meant to be:
- Read selectively
- Applied intentionally
- Enforced socially (via reviews and conventions)
You do not need every pattern in every project.
Introduce patterns only when the corresponding problem actually appears.
Pattern Categories
The patterns in this section generally fall into three categories:
1. Boundary Protection Patterns
Patterns that protect architectural boundaries and prevent framework creep.
Examples:
- Thin Handlers
- Explicit Middleware Chains
- Boundary Translation
2. Control & Flow Patterns
Patterns that make execution order, responsibility, and side effects visible.
Examples:
- Explicit Error Mapping
- Centralized Decision Points
- No Hidden Control Flow
3. Operational Safety Patterns
Patterns that improve reliability and operability without adding magic.
Examples:
- Request-Scoped Metadata
- Fail-Fast Boundaries
- Defensive Integration Patterns
Recommended Reading Order
If you are new to the Patterns section, start here:
Thin Handlers
Establishes the most important boundary discipline.Explicit Middleware Chains
Prevents hidden behavior and ordering bugs.Explicit Error Mapping
Keeps failure semantics understandable.Boundary Translation
Reinforces separation between transport and core logic.
Each pattern builds on the previous ones.
Patterns and Team Discipline
Patterns are only effective if:
- Teams agree to follow them
- Violations are discussed explicitly
- Exceptions are documented intentionally
Patterns do not replace thinking.
They reduce the cost of thinking repeatedly about the same problems.
When Patterns Matter Most
Pay close attention to this section if:
- Your codebase is growing quickly
- Multiple engineers are contributing
- Review discussions repeat the same concerns
- Handlers and middleware are getting larger
- Framework concepts start leaking inward
Patterns act as early-warning systems.
Summary
The Patterns section exists to:
- Encode hard-earned lessons
- Preserve architectural clarity
- Make good practices repeatable
- Slow down long-term decay
Plumego gives you freedom.
Patterns help you use that freedom responsibly.
Next
If you are just starting with Patterns:
→ Thin Handlers
If you already apply that discipline:
→ Explicit Middleware Chains
Both will immediately improve code clarity.