Skip to content

[REFACTOR] Remove unnecessary factories - C++20 Module preparation #274

Description

@kcenon

Summary

Review and consolidate factory classes in logger_system to simplify the codebase for C++20 module migration, following Kent Beck's "Fewest Elements" principle.

Parent Epic

Part of kcenon/common_system#256 (C++20 Module Migration - Cross-System Preparation)

Current State

Factory Inventory

File Class Purpose
core/di/di_container_factory.h di_container_factory DI container creation
core/monitoring/monitoring_factory.h monitoring_factory Monitoring integration

Problem Analysis

Issue Kent Beck Principle
Multiple factory patterns Fewest Elements
Unclear when to use each factory Reveals Intention
Factory vs Builder pattern overlap No Duplication

C++20 Module Impact

When converting to modules, factory classes add complexity to module boundaries:

export module kcenon.logger;
// Factories complicate the public API surface

Proposed Analysis Tasks

  • Audit all factory classes for usage patterns
  • Identify factories that can be replaced with builders
  • Consolidate overlapping factory functionality
  • Document remaining factories with clear purpose

Tasks

  • Review di_container_factory usage and necessity
  • Review monitoring_factory usage and necessity
  • Identify unused or redundant factory methods
  • Create consolidation plan
  • Implement changes with deprecation warnings
  • Update documentation

Acceptance Criteria

  • All factory classes have clear, documented purpose
  • No redundant factory implementations
  • Factory patterns simplified for module conversion
  • All tests pass
  • No breaking changes to public API

Related

Metadata

Metadata

Assignees

Labels

architectureArchitectural changes and designrefactoringCode refactoring and improvements

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions