Skip to content
bitzorcas
中EN

Guide

Business Modules Architecture & Extension Guide

In-depth guide to BitzOrcas.Modern business module architecture, ADR 0203 physical isolation, ADR 0205 platform extension paradigms, and the Sandbox Golden Use Case.

Last updated

Business Modules Architecture & Extension Guide

When building enterprise business applications (such as law practice management, litigation collaboration, financial risk control, or commerce backends) on top of BitzOrcas.Modern, Business Modules (Modules) represent the sole legitimate location for proprietary business logic, custom aggregate roots, and industry use cases.

Under ADR 0203 (Physical Directory Structure) and ADR 0205 (Commercial Package Distribution & Extension Model), consumer solutions are strictly prohibited from modifying framework internals (src/Framework) or built-in platform capabilities (src/Platform). All custom business features reside strictly within the src/Modules/** physical directory.


1. Physical Directory Structure & Anti-Corruption Isolation (ADR 0203)

src/Modules/ Business Module Layout ExampleSource Code Top-Level Physical LayersStrictly depends onContracts / Extension PortsBuilt on Core Pipelines

src/Framework/ (Pure technical base, zero business dependencies)

src/Platform/ (36 platform capability subsystems, delivered as packages)

src/Modules/ (Adopter business module workspace)

src/Modules/Litigation/ (Litigation & Cases Domain)

src/Modules/Contracts/ (Contract Review Domain)

src/Modules/Evidence/ (Electronic Evidence Domain)

src/Modules/Sandbox/ (Built-in Golden Use Case)

1.1 Module Directory Naming Conventions

  • Business Category Path: src/Modules/<DomainCategory>/<ModuleName>/
  • Recommended Four-Layer Physical Project Structure:
    1. BitzOrcas.Modules.<ModuleName>.Contracts: Publicly exposed DTOs, interfaces, and integration events;
    2. BitzOrcas.Modules.<ModuleName>.Domain: Aggregate roots, entities, value objects, and domain events;
    3. BitzOrcas.Modules.<ModuleName>.Application: CQRS Command/Query, Mediator Handlers, IRequestRule<T> validation;
    4. BitzOrcas.Modules.<ModuleName>.Infrastructure: SqlSugar / EF Core dual ORM repository adapters, persistence models, and Outbox event dispatchers.

2. Platform Capability Consumption & Extension Patterns (ADR 0205)

Business modules and platform capabilities follow a strict Deep Module unidirectional dependency rule:

Platform Kernel (Signed Commercial Package)CAP Outbox (RabbitMQ)Platform ContractsBusiness Use Case (Modules.Litigation)Platform Kernel (Signed Commercial Package)CAP Outbox (RabbitMQ)Platform ContractsBusiness Use Case (Modules.Litigation)1. Synchronous Contract Call (Depends strictly on public Contracts)2. Asynchronous Fact Decoupling (Versioned Integration Events)Reference IAIConversationPort / IFileStoragePort1Dispatch Mediator command or endpoint request2Return strongly typed Result<T> (Internal entities never exposed)3Publish UserCreatedIntegrationEvent4Consume event and provision attorney workspace5
Extension PatternUse CaseArchitectural Guardrail
Contracts ReferenceBusiness module needs identity, file, or notification capabilitiesOnly ProjectReference or PackageReference to *.Contracts is allowed; Architecture tests statically guard against referencing .Application or .Infrastructure
Event-Driven Integration (CAP Outbox)Cross-module state synchronization and workflow triggersFollows ADR 0304, leveraging RabbitMQ + CAP Outbox to deliver versioned integration events for eventual consistency
Dynamic Validation StrategiesTenant-specific business validation and admission rulesRegister ITenantValidationStrategy<TRequest> to enforce tenant-scoped rules in the Mediator pipeline (ADR 0403)
Store Port OverridingCustom data persistence and specialized read modelsImplement module-specific Store ports and bind them in the Host composition root

3. Business Modules Deep-Dive Navigation

To guide engineering teams building production-grade domain modules, this section includes dedicated in-depth chapters:

  1. Sandbox Golden Sample Architecture: Three-tier physical boundaries, CQRS vertical slices, aggregate roots, and immutable error catalogs;
  2. Module Lifecycle & Modularity Engine: Dependency graph topological sorting, automatic DI wiring, and middleware registration;
  3. Profiles & Metapackage Tailoring Architecture: Metapackage orchestration for tenant-specific editions, deployment footprints, and commercial delivery.

4. Built-in Platform Capabilities

When developing business modules, prioritize reusing the 36 mature infrastructure and domain capabilities provided by the platform:

Explore 36 Platform Capabilities in the Platform Center

Including:

100%

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