Skip to main content

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

  1. Cognitive Load: Developers cannot easily find relevant code. "Where is the Checkout logic?" requires searching through 70 files.
  2. Coupling: Classes in the same namespace tend to use internal visibility or be closely coupled, making it hard to extract pieces later.
  3. Merge Conflicts: A single folder constantly touched by everyone increases git conflicts.

Remediation

  1. Vertical Slicing: Group by Feature, not technical layer.
    • Bad: FrontApiBiz/CheckoutService.cs, FrontApiBiz/ProfileService.cs
    • Good: Features/Checkout/*, Features/Profile/*
  2. Extract Sub-Namespaces: Break the God Namespace into logical sub-modules.
    • WepBusiness.FRONT.Checkout
    • WepBusiness.FRONT.Account
    • WepBusiness.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.