Skip to content
bitzorcas
中EN

Concept

ADR 0203: Physical Directory Structure Framework + Modules

Restructure top-level codebase into Framework, Platform, and Modules layers to physically separate foundation, platform capabilities, and business domain code.

Last updated

ADR 0203: Physical Directory Structure Framework + Modules

Status

Accepted

Date

2026-06-30

Context

BitzOrcasVNext historically used a flat BuildingBlocks/ + Platform/ layout under src/. As the modular monolith matured and business modules grew, this layout introduced two major issues:

  1. Semantic Ambiguity: BuildingBlocks did not clearly communicate “framework foundation”, while Platform blurred the boundary between system-level platform capabilities and business modules.
  2. Insufficient Anti-Corruption Isolation: Framework cores (Domain, Application, Infrastructure, Source Generators) resided alongside default Platform capabilities in the same tier, risking tight coupling during feature evolution.

Proven architectures like ABP demonstrate that technical foundations and business modules should be physically separated to eliminate accidental coupling.

Decision

Reorganize the top-level src/ directory into Framework/ + Platform/ + Modules/:

1. BuildingBlocks → Framework

src/Framework/ contains pure technical framework building blocks with zero business dependencies:

Sub-GroupProjectsResponsibility
CoreDomain / Application / ModularityDomain primitives, application pipelines, module governance
SourceGeneratorsDI.Attributes / DI.SourceGenerator / Endpoint.SourceGeneratorReflection-free compile-time DI and endpoint discovery (ADR 0103)
CodeGenerationCodeGeneration.Abstractions / CodeGeneration.ScribanTemplate code generation and input audit
Persistence.MetadataPersistence.Metadata / Persistence.Metadata.GeneratorProvider-neutral metadata and ORM Fluent configuration generators
InfrastructureInfrastructure / Infrastructure.SqlSugar / EfCore / Dapper / Storage.S3CompatibleDatabase adapters and storage drivers
WorkflowWorkflow.Abstractions / Engine / Persistence / SqlSugar / EfCore / DapperSelf-built lightweight high-performance workflow engine

2. Platform → src/Platform

src/Platform/ is the canonical home for default template platform capabilities. It sits alongside src/Modules/**, physically demarcating template assets from customer business code.

LocationRoleStatus
src/Platform/**Target structure for default Platform assets; houses 36 built-in platform capabilitiesCanonical
src/Modules/<Category>/<Module>/**Business domain modules created by adoptersBusiness
src/Modules/Sandbox/**Reference implementation and architectural test sandboxSample

Adopters building business applications must create their business modules under /src/Modules/{BusinessModule}/ rather than modifying default Platform source trees.

3. Invariants

  • Assembly Names Unchanged: All .csproj <AssemblyName> tags remain unchanged (e.g., BitzOrcas.Platform.Application).
  • Namespaces Unchanged: All C# namespace declarations remain intact.
  • Hosts and Tooling Unchanged: src/Hosts/ and src/Tooling/ remain in place.

Constraints

  1. Project file names (.csproj) are not renamed; only physical directory paths are restructured.
  2. New built-in platform capabilities must be placed under src/Platform/<Capability>/.
  3. New business modules must be placed under src/Modules/.

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%