Update class diagrams

This commit is contained in:
Aaron Po
2026-05-14 19:49:14 -04:00
parent 2ee7b3d2a2
commit f35c563dac
2 changed files with 80 additions and 20 deletions

View File

@@ -26,6 +26,7 @@ skinparam note {
title The Biergarten Data Pipeline - Class Diagram title The Biergarten Data Pipeline - Class Diagram
class BiergartenDataGenerator { class BiergartenDataGenerator {
- logger_ : std::shared_ptr<ILogger>
- context_service_ : std::unique_ptr<IEnrichmentService> - context_service_ : std::unique_ptr<IEnrichmentService>
- generator_ : std::unique_ptr<DataGenerator> - generator_ : std::unique_ptr<DataGenerator>
- exporter_ : std::unique_ptr<IExportService> - exporter_ : std::unique_ptr<IExportService>
@@ -36,6 +37,46 @@ class BiergartenDataGenerator {
- LogResults() : void - LogResults() : void
} }
class LogLevel <<enumeration>> {
Debug
Info
Warn
Error
}
class PipelinePhase <<enumeration>> {
Startup
UserGeneration
BreweryAndBeerGeneration
CheckinGeneration
RatingGeneration
FollowGeneration
Teardown
}
struct LogEntry {
+ timestamp : std::chrono::system_clock::time_point
+ level : LogLevel
+ phase : PipelinePhase
+ message : std::string
+ worker : std::optional<std::string>
}
interface ILogger <<interface>> {
+ Log(entry : const LogEntry&) : void
}
class LogProducer {
- channel_ : BoundedChannel<LogEntry>&
+ Log(entry : const LogEntry&) : void
}
class LogDispatcher {
- channel_ : BoundedChannel<LogEntry>&
+ Run() : void
- ToSpdlogLevel(level) : spdlog::level::level_enum
}
interface IEnrichmentService <<interface>> { interface IEnrichmentService <<interface>> {
+ GetLocationContext(loc : const Location&) : std::string + GetLocationContext(loc : const Location&) : std::string
} }
@@ -123,10 +164,17 @@ class SystemDateTimeProvider {
} }
' Structural Relationships / Dependency Injection ' Structural Relationships / Dependency Injection
BiergartenDataGenerator *-- ILogger : owns
BiergartenDataGenerator *-- IEnrichmentService : owns BiergartenDataGenerator *-- IEnrichmentService : owns
BiergartenDataGenerator *-- DataGenerator : owns BiergartenDataGenerator *-- DataGenerator : owns
BiergartenDataGenerator *-- IExportService : owns BiergartenDataGenerator *-- IExportService : owns
LogEntry *-- LogLevel
LogEntry *-- PipelinePhase
ILogger <|.. LogProducer : implements
LogProducer ..> LogEntry : emits
LogDispatcher ..> LogEntry : consumes
IEnrichmentService <|.. WikipediaService : implements IEnrichmentService <|.. WikipediaService : implements
WikipediaService *-- WebClient : owns WikipediaService *-- WebClient : owns

View File

@@ -1,4 +1,4 @@
@startuml @startuml class_diagram
' ========================================== ' ==========================================
' CONFIGURATION & STYLING ' CONFIGURATION & STYLING
@@ -8,6 +8,8 @@ skinparam classAttributeFontSize 9
skinparam defaultFontSize 25 skinparam defaultFontSize 25
skinparam titleFontSize 30 skinparam titleFontSize 30
title Biergarten Data Pipeline — Class Diagram
package "Domain: Models" { package "Domain: Models" {
class Location { class Location {
@@ -141,7 +143,7 @@ package "Domain: Models" {
LocationContext *-- Completeness LocationContext *-- Completeness
} }
@startuml
package "Domain: Application Configuration" { package "Domain: Application Configuration" {
class SamplingOptions { class SamplingOptions {
+ temperature: float = 1.0F + temperature: float = 1.0F
@@ -167,12 +169,10 @@ package "Domain: Application Configuration" {
+ pipeline: PipelineOptions + pipeline: PipelineOptions
} }
' --- Domain Model Relationships ---
ApplicationOptions *-- GeneratorOptions ApplicationOptions *-- GeneratorOptions
ApplicationOptions *-- PipelineOptions ApplicationOptions *-- PipelineOptions
GeneratorOptions o-- SamplingOptions GeneratorOptions o-- SamplingOptions
} }
@endum
package "Domain: Policy" { package "Domain: Policy" {
@@ -275,33 +275,29 @@ package "Infrastructure: Logging" {
+ level : LogLevel + level : LogLevel
+ phase : PipelinePhase + phase : PipelinePhase
+ message : std::string + message : std::string
+ city : std::optional<std::string>
+ entity_id : std::optional<std::string>
+ worker : std::optional<std::string> + worker : std::optional<std::string>
} }
interface Logger <<interface>> { interface ILogger <<interface>> {
+ Log(level, phase, message,\n city, entity_id, worker) : void + Log(entry : const LogEntry&) : void
} }
class PipelineLogger { class LogProducer {
- log_ch_ : BoundedChannel<LogEntry>& - channel_ : BoundedChannel<LogEntry>&
+ Log(level, phase, message,\n city, entity_id, worker) : void + Log(entry : const LogEntry&) : void
} }
class LogWorker { class LogDispatcher {
- log_ch_ : BoundedChannel<LogEntry>& - channel_ : BoundedChannel<LogEntry>&
+ Run() : void + Run() : void
- FormatTimestamp(tp) : std::string
- ToSpdlogLevel(level) : spdlog::level::level_enum - ToSpdlogLevel(level) : spdlog::level::level_enum
- ToString(phase) : std::string
} }
' --- Logging Relationships ---
LogEntry *-- LogLevel LogEntry *-- LogLevel
LogEntry *-- PipelinePhase LogEntry *-- PipelinePhase
PipelineLogger ..> LogEntry : emits ILogger <|.. LogProducer
LogWorker ..> LogEntry : consumes LogProducer ..> LogEntry : emits
LogDispatcher ..> LogEntry : consumes
} }
package "Infrastructure: Pipeline Channel" { package "Infrastructure: Pipeline Channel" {
@@ -363,6 +359,22 @@ package "Infrastructure: Enrichment" {
} }
package "Infrastructure: Prompting" {
interface IPromptDirectory <<interface>> {
+ Load(key : std::string_view) : std::string
}
class PromptDirectory {
- prompt_dir_ : std::filesystem::path
- cache_ : std::unordered_map<std::string, std::string>
+ PromptDirectory(prompt_dir : const std::filesystem::path&)
+ Load(key : std::string_view) : std::string
}
IPromptDirectory <|.. PromptDirectory
}
package "Infrastructure: Data Generation" { package "Infrastructure: Data Generation" {
interface DataGenerator <<interface>> { interface DataGenerator <<interface>> {
@@ -386,6 +398,7 @@ package "Infrastructure: Data Generation" {
- model_ : ModelHandle - model_ : ModelHandle
- context_ : ContextHandle - context_ : ContextHandle
- prompt_formatter_ : std::unique_ptr<PromptFormatter> - prompt_formatter_ : std::unique_ptr<PromptFormatter>
- prompt_directory_ : std::unique_ptr<IPromptDirectory>
- rng_ : std::mt19937 - rng_ : std::mt19937
+ GenerateBrewery(...) : BreweryResult + GenerateBrewery(...) : BreweryResult
+ GenerateBeer(...) : BeerResult + GenerateBeer(...) : BeerResult
@@ -459,8 +472,6 @@ package "Infrastructure: Data Export" {
} }
class BiergartenPipelineOrchestrator { class BiergartenPipelineOrchestrator {
- preloader_ : std::unique_ptr<DataPreloader> - preloader_ : std::unique_ptr<DataPreloader>
- enrichment_service_ : std::unique_ptr<EnrichmentService> - enrichment_service_ : std::unique_ptr<EnrichmentService>
@@ -531,6 +542,7 @@ DateTimeProvider <|.. SystemDateTimeProvider
WikipediaService *-- WebClient WikipediaService *-- WebClient
WikipediaService ..> ContextStrategy WikipediaService ..> ContextStrategy
LlamaGenerator *-- PromptFormatter LlamaGenerator *-- PromptFormatter
LlamaGenerator *-- IPromptDirectory
LlamaGenerator ..> GeneratorOptions LlamaGenerator ..> GeneratorOptions
SqliteExportService *-- DateTimeProvider SqliteExportService *-- DateTimeProvider