How martinothamar/mediator works
Main Components
a. Core Components:
• Mediator Implementation (Generated)
• Message Types System
• Handler System
• Pipeline System
• Publisher System
• Source Generator
b. Supporting Components:
• Dependency Injection Integration
• Diagnostics System
• Configuration System
┌─ Application Layer ─────────────────────────────────────┐
• Client Code (Controllers/Services) │
• Mediator Interface Layer ──────────────────────────────┤
• IMediator ISender IPublisher│
• Message Layer ──────────────────────────────────────┐ │
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │ │
• Requests │ │ Commands │ │ Notifications │ │ │
• IRequest<T> │ │ ICommand<T> │ │ INotification │ │ │
• ┘ └──────────────┘ └───────────────┘ │ │
• Handler Layer ─────────────────────────────────────┤ │
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │ │
• Request │ │Command │ │Notification │ │ │
• Handlers │ │Handlers │ │Handlers │ │ │
• ┘ └──────────────┘ └───────────────┘ │ │
• Pipeline Layer ────────────────────────────────────┤ │
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │ │
• Pre- │ │Pipeline │ │Post- │ │ │
• Processors │ │Behaviors │ │Processors │ │ │
• ┘ └──────────────┘ └───────────────┘ │ │
• ┘ │
• Source Generator Layer ───────────────────────────────┤
• ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
• Code │ │Diagnostic │ │DI │ │
• Generation │ │Analysis │ │Registration │ │
• ┘ └──────────────┘ └───────────────┘ │
• ┘
Flow Indicators
• Message flow from client through mediator to handlers
• Pipeline behavior execution chain
• Source generator output flow
• Dependency injection registration flow
Additional Details
Callouts for:
• Default configurations
• Performance characteristics
• AOT compatibility points
• Build-time vs runtime components
Notes Section
Notes about:
• Source generator implementation details
• Performance considerations
• Configuration options
• Diagnostic capabilities
Remember to emphasize the high-performance aspects and build-time validation capabilities that make this implementation unique compared to traditional mediator pattern implementations.