Skip to the content.

Framework Optimization Roadmap

This document tracks the review items that are intentionally staged instead of completed as a large breaking rewrite.

P3: Split Infrastructure

Current state:

This change set:

Target split order:

  1. MS.Microservice.Persistence.EFCore - completed in this change set.
  2. MS.Microservice.Persistence.SqlSugar - completed in this change set.
  3. MS.Microservice.Observability
  4. MS.Microservice.Excel
  5. MS.Microservice.Audio
  6. MS.Microservice.Messaging.Wolverine

Expected extension methods:

services.AddMicroserviceEfCorePersistence(configuration);
services.AddMicroserviceSqlSugarPersistence(configuration);
services.AddMicroserviceObservability(configuration);
services.AddMicroserviceExcel();
services.AddMicroserviceAudio();
services.AddMicroserviceWolverineMessaging(configuration);

Reason not completed in this change:

Remaining TODO:

New findings:

P4: Domain Events, Outbox, and Inbox

Current state:

This change set:

Target production flow:

Aggregate produces DomainEvent
Application Service calls Repository
UnitOfWork SaveChanges
Collect DomainEvents
Write Outbox in the same transaction
Background worker publishes IntegrationEvent
Consumer writes Inbox receipt
Retry / dead-letter / trace correlation

Planned abstractions:

public interface IHasDomainEvents
{
    IReadOnlyCollection<IDomainEvent> DomainEvents { get; }
    void ClearDomainEvents();
}

public interface IDomainEventDispatcher
{
    Task DispatchAsync(IEnumerable<IDomainEvent> domainEvents, CancellationToken cancellationToken = default);
}

public interface IIntegrationEventPublisher
{
    Task PublishAsync(object integrationEvent, CancellationToken cancellationToken = default);
}

Planned persistence records:

Remaining gap:

New findings:

P5: Samples and Documentation

Current state:

Planned samples:

  1. samples/Sample.TodoService
    • Minimal CRUD
    • EF Core
    • Swagger
    • Logging
  2. samples/Sample.OrderService
    • DDD aggregate
    • DomainEvent
    • Outbox
    • EventBus
  3. samples/Sample.AIService
    • Chat
    • TTS
    • ASR
    • Provider switching
    • Usage reporting

Reason not completed in this change:

AI Production Readiness

Implemented:

Completed next steps:

Remaining production TODO: