Anti-Pattern: God Namespace (Folder Bloat)
Description
A God Namespace occurs when a single namespace (and usually a corresponding folder) becomes a dumping ground for unrelated classes, often exceeding 50+ or 100+ files.
This usually happens when the organization is by "Layer" (e.g., Biz, DTOs) rather than by "Feature" or "Domain".
Evidence
- Namespace:
WepBusiness.FRONT.FrontApiBiz - Stats: Contains 71 items (classes/files).
- Observation: It mixes disparate concerns like Profile Management, Checkout, Product Catalogs, and Search logic into a single flat bucket.
Impact
- Cognitive Load: Developers cannot easily find relevant code. "Where is the Checkout logic?" requires searching through 70 files.
- Coupling: Classes in the same namespace tend to use
internalvisibility or be closely coupled, making it hard to extract pieces later. - Merge Conflicts: A single folder constantly touched by everyone increases git conflicts.
Remediation
- Vertical Slicing: Group by Feature, not technical layer.
- Bad:
FrontApiBiz/CheckoutService.cs,FrontApiBiz/ProfileService.cs - Good:
Features/Checkout/*,Features/Profile/*
- Bad:
- Extract Sub-Namespaces: Break the God Namespace into logical sub-modules.
WepBusiness.FRONT.CheckoutWepBusiness.FRONT.AccountWepBusiness.FRONT.Catalog
2026 Audit Findings
- Occurrences: 71 files in
WepBusiness.FRONT.FrontApiBiz. - Analysis: A single folder acting as a catch-all for frontend logic, coupling the Monolith to the UI.