Vertical Slice Architecture offers flexibility but creates challenges around shared code placement. The article proposes a three-tier framework: freely share technical infrastructure (logging, database connections), push domain logic into entities and value objects, and keep feature-specific logic local within feature folders. Cross-feature sharing should be minimized—most cases are actually data access in disguise. The key principle is that duplication is often cheaper than premature abstraction, and code should be organized by its nature (domain, infrastructure, or cross-cutting) rather than forced into a common junk drawer.
Table of contents
The Guardrails vs. The Open RoadThe Trap: The "Common" Junk DrawerThe Decision FrameworkThe Three Tiers of SharingCross-Feature SharingWhen Duplication Is the Right CallThe Practical StructureThe RulesTakeaway4 Comments
Sort: