Skip to content

refactor(factories): remove unnecessary di_container_factory and monitoring_factory#276

Merged
kcenon merged 3 commits into
mainfrom
refactor/remove-unnecessary-factories-274
Jan 3, 2026
Merged

refactor(factories): remove unnecessary di_container_factory and monitoring_factory#276
kcenon merged 3 commits into
mainfrom
refactor/remove-unnecessary-factories-274

Conversation

@kcenon

@kcenon kcenon commented Jan 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove redundant di_container_factory and monitoring_factory implementations
  • Remove unimplemented DI methods from logger.h
  • Update tests and documentation to reflect the changes

Changes

Removed Files

File Reason
include/kcenon/logger/core/di/di_container_factory.h Simple wrapper, unused container types
include/kcenon/logger/core/di/di_container_interface.h Non-template interface, never used
include/kcenon/logger/core/monitoring/monitoring_factory.h Embedded class, redundant
src/impl/di/di_container_factory.h Thread_system fallback never invoked
src/impl/monitoring/monitoring_factory.h Thread_system fallback never invoked

Modified Files

File Change
logger.h Removed unimplemented DI methods and includes
di_container_test.cpp Updated include paths, removed factory tests
monitoring_test.cpp Updated include paths, removed factory tests
API_REFERENCE.md Removed DI section
ARCHITECTURE.md Updated factory pattern description
STRUCTURE.md Removed DI folder references

Retained Factories (Actively Used)

  • filter_factory: Log filtering with builder pattern
  • formatter_factory: Output formatters with presets
  • writer_factory: Writer creation with presets

Motivation

This follows Kent Beck's "Fewest Elements" principle by removing factory patterns that added complexity without providing value. The removed factories:

  1. Had overlapping/duplicate implementations (public API vs internal)
  2. Were never used in production code
  3. Had unimplemented methods in the public API
  4. Added complexity to module boundaries for C++20 migration

Test plan

  • Verify build succeeds with cmake --build build
  • Verify remaining DI container tests pass
  • Verify monitoring tests pass
  • Verify no compile errors from removed includes

Closes #274

kcenon added 3 commits January 3, 2026 08:16
…toring_factory

Remove redundant factory implementations as part of C++20 module preparation:

- Remove public API factories (include/kcenon/logger/core/di/, monitoring/)
  - di_container_factory.h: simple wrapper with unused container types
  - di_container_interface.h: non-template interface never used
  - monitoring_factory.h: embedded simple_monitor class, redundant

- Remove internal factories (src/impl/di/, monitoring/)
  - di_container_factory.h: thread_system fallback logic never invoked
  - monitoring_factory.h: thread_system fallback logic never invoked

- Remove unimplemented DI methods from logger.h:
  - set_di_container(), has_di_container()
  - add_writer_from_di(), register_writer_factory()
  - enable_di(), get_di_strategy()

- Update tests to remove factory-related test cases
- Update documentation to remove factory references

This follows Kent Beck's "Fewest Elements" principle by removing
factory patterns that added complexity without providing value.

The following factories are retained and actively used:
- filter_factory: log filtering with builder pattern
- formatter_factory: output formatters with presets
- writer_factory: writer creation with presets

Closes #274
- Remove di/di_container_interface.h include from logger_builder.h
- Remove DI Container examples from INTEGRATION.md documentation
- Remove DI Container reference from STRUCTURE.md table
- Remove unused mock_di_container.hpp test file

This fixes the CI build failure caused by missing di_container_interface.h.
- Fix ci::source_location to kcenon::common::source_location in
  di_pattern_example.cpp
- Remove outdated tests/unit/integration_test directory that used
  old source structure and referenced deleted files
- Update tests/unit/CMakeLists.txt to remove integration_test subdirectory
@kcenon kcenon merged commit 7e8d649 into main Jan 3, 2026
29 checks passed
@kcenon kcenon deleted the refactor/remove-unnecessary-factories-274 branch January 3, 2026 02:30
kcenon added a commit that referenced this pull request Apr 13, 2026
…toring_factory (#276)

* refactor(factories): remove unnecessary di_container_factory and monitoring_factory

Remove redundant factory implementations as part of C++20 module preparation:

- Remove public API factories (include/kcenon/logger/core/di/, monitoring/)
  - di_container_factory.h: simple wrapper with unused container types
  - di_container_interface.h: non-template interface never used
  - monitoring_factory.h: embedded simple_monitor class, redundant

- Remove internal factories (src/impl/di/, monitoring/)
  - di_container_factory.h: thread_system fallback logic never invoked
  - monitoring_factory.h: thread_system fallback logic never invoked

- Remove unimplemented DI methods from logger.h:
  - set_di_container(), has_di_container()
  - add_writer_from_di(), register_writer_factory()
  - enable_di(), get_di_strategy()

- Update tests to remove factory-related test cases
- Update documentation to remove factory references

This follows Kent Beck's "Fewest Elements" principle by removing
factory patterns that added complexity without providing value.

The following factories are retained and actively used:
- filter_factory: log filtering with builder pattern
- formatter_factory: output formatters with presets
- writer_factory: writer creation with presets

Closes #274

* fix(build): remove remaining DI container references from header files

- Remove di/di_container_interface.h include from logger_builder.h
- Remove DI Container examples from INTEGRATION.md documentation
- Remove DI Container reference from STRUCTURE.md table
- Remove unused mock_di_container.hpp test file

This fixes the CI build failure caused by missing di_container_interface.h.

* fix(build): resolve source_location namespace and remove outdated tests

- Fix ci::source_location to kcenon::common::source_location in
  di_pattern_example.cpp
- Remove outdated tests/unit/integration_test directory that used
  old source structure and referenced deleted files
- Update tests/unit/CMakeLists.txt to remove integration_test subdirectory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant