← ClaudeAtlas

rules-patternslisted

Reference catalogue of the ten design patterns used in Jardis (Facade, Strategy, Adapter, Value Object, Factory, Repository, Decorator, Priority-Based Layers, Chain of Responsibility, Lazy Initialization). Consult before introducing a pattern.
jardisTools/dev-skills · ★ 0 · AI & Automation · score 76
Install: claude install-skill jardisTools/dev-skills
## Scope Applies to Jardis packages (`JardisAdapter/*`, `JardisSupport/*`, `JardisTools/*`). Generated Domain code already applies most patterns for you (Facade on `<Agg>.php`, Repository for persistence, Factory/Strategy inside `handle()`) — how the generator itself enforces these: [[beschreibt-bauweise-von::builder-generator-registry-bauweise]] §9. Phase-3 extensions most often use **Value Object**, **Decorator** (via `v2` overrides), **Adapter** (via Domain Services). The gate in §3 applies to all. ### 1. Pattern catalogue | Pattern | Use for | Core rule | |---|---|---| | **Facade** | Simplifying complex subsystems | Thin, delegates, no business logic | | **Strategy** | Interchangeable implementations | Clear interface, stateless, Constructor Injection | | **Priority-Based Layers** | Fallback / broadcast | Lower number = consulted first | | **Chain of Responsibility** | Sequential pipeline | Handler decides: pass on or terminate | | **Lazy Initialization** | Expensive resources | `$this->connection ??= $this->create()` | | **Adapter** | Wrapping third-party | Own interface, Adapter implements | | **Value Object** | Immutable data by value | Readonly, equality by value, no ID | | **Factory** | Complex object creation | `match($type)` dispatch, never `new` in business logic | | **Repository** | Data access abstraction | Domain defines interface, Infra implements | | **Decorator** | Dynamically adding behaviour | Same signature, wraps inner | No problem, no pattern. ###