System Architecture Overview¶
This document provides a high-level overview of the Open Resource Broker's system architecture, focusing on the overall structure, key components, and architectural decisions.
Related Documentation: - Developer Guide: Architecture - Development-focused architectural guidance - Architecture: Clean Architecture - Detailed Clean Architecture implementation
Architecture Principles¶
The plugin implements Clean Architecture principles with clear separation of concerns across four distinct layers:
- Domain Layer: Core business logic and entities
- Application Layer: Use cases and application services
- Infrastructure Layer: External integrations and technical concerns
- Interface Layer: External interfaces (CLI, REST API)
Implemented Patterns¶
CQRS (Command Query Responsibility Segregation)¶
Status: Implemented
- Command Handlers: write operations (mutate state, return void)
- Query Handlers: read operations (return data, no side effects)
Clean Architecture¶
Status: Implemented
- Layers: domain, application, infrastructure, interface
Dependency Injection¶
Status: Implemented
Strategy Pattern¶
Status: Implemented
Layer Structure¶
Domain Layer (src/domain/)¶
The domain layer contains the core business logic and is independent of external concerns.
Core Aggregates¶
- Template: Represents VM template configurations
- Machine: Represents provisioned compute instances
- Request: Represents provisioning requests
Application Layer (src/application/)¶
Contains use cases and application services that orchestrate domain objects.
CQRS Implementation¶
- Command handlers for write operations
- Query handlers for read operations
- Event handlers for domain events
Infrastructure Layer (src/infrastructure/)¶
Implements technical concerns and external integrations.
Key Components¶
- Dependency injection container
- Persistence implementations
- External service integrations
- Configuration management
Interface Layer (src/interface/)¶
Provides external interfaces and entry points.
Architecture Quality¶
Recommendations¶
- Layer Isolation: Ensure dependencies flow inward (Interface → Infrastructure → Application → Domain)
- CQRS Compliance: Verify all handlers inherit from appropriate base classes
- Pattern Consistency: Maintain consistent implementation of architectural patterns