Skip to content

feat(di): implement service registration in unified_bootstrapper#320

Merged
kcenon merged 1 commit into
mainfrom
feat/issue-317-implement-service-registration-in-unified-bootstrapper
Jan 31, 2026
Merged

feat(di): implement service registration in unified_bootstrapper#320
kcenon merged 1 commit into
mainfrom
feat/issue-317-implement-service-registration-in-unified-bootstrapper

Conversation

@kcenon

@kcenon kcenon commented Jan 30, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the placeholder service registration methods in unified_bootstrapper to support conditional service registration based on compile-time feature detection and runtime configuration.

Changes Made

  • Added #include "../config/feature_system_deps.h" for feature detection macros
  • Enhanced register_core_services() with clear documentation about future extensibility
  • Implemented register_optional_services() with conditional compilation support:
    • Logger system integration (via KCENON_WITH_LOGGER_SYSTEM)
    • Monitoring system integration (via KCENON_WITH_MONITORING_SYSTEM)
    • Database system integration (via KCENON_WITH_DATABASE_SYSTEM)
    • Network system integration (via KCENON_WITH_NETWORK_SYSTEM)
  • Used [[maybe_unused]] attribute to prevent compiler warnings
  • Added comprehensive inline documentation explaining adapter integration pattern

Technical Approach

The implementation uses a two-level conditional check:

  1. Runtime check: bootstrapper_options flags (enable_logging, enable_monitoring, etc.)
  2. Compile-time check: Feature detection macros (KCENON_WITH_*_SYSTEM)

This allows graceful degradation when subsystems are not available, enabling the bootstrapper to work with any combination of subsystems without requiring all dependencies.

Design Pattern

Each subsystem is expected to provide a registration function via adapters:

namespace kcenon::<subsystem>::di {
    VoidResult register_<subsystem>_services(service_container& container);
}

When adapters are implemented, they can be called within the conditional blocks.

Test Plan

  • Build succeeds without warnings
  • All existing tests pass (115/115)
  • No runtime behavior changes (adapters not yet implemented)
  • Code compiles with and without subsystem feature flags

Build Results

100% tests passed, 0 tests failed out of 115
Total Test time (real) = 50.81 sec

Breaking Changes

None - This is a backward-compatible enhancement.

Related Issues

Part of #314 (Epic: Consolidate cross-system infrastructure components)
Closes #317

Files Modified

  • include/kcenon/common/di/unified_bootstrapper.h: Service registration implementation

Next Steps

After this PR:

  1. Each subsystem team can implement their adapter's register_*_services() function
  2. The bootstrapper will automatically integrate with available subsystems
  3. No changes to unified_bootstrapper will be needed for future subsystem additions

Add conditional service registration framework for unified_bootstrapper
that allows subsystems to register services via adapters.

Changes:
- Include feature_system_deps.h for feature detection macros
- Update register_core_services() with clear documentation
- Implement register_optional_services() with conditional compilation
- Add support for logger, monitoring, database, and network systems
- Use [[maybe_unused]] attribute to avoid compiler warnings
- Graceful degradation when subsystems are not available

The implementation uses KCENON_WITH_*_SYSTEM macros to detect
available subsystems at compile time, allowing the bootstrapper
to work with any combination of subsystems.

Part of #314
Closes #317
@kcenon kcenon merged commit 06971e4 into main Jan 31, 2026
30 checks passed
@kcenon kcenon deleted the feat/issue-317-implement-service-registration-in-unified-bootstrapper branch January 31, 2026 03:39
kcenon added a commit that referenced this pull request Apr 13, 2026
Add conditional service registration framework for unified_bootstrapper
that allows subsystems to register services via adapters.

Changes:
- Include feature_system_deps.h for feature detection macros
- Update register_core_services() with clear documentation
- Implement register_optional_services() with conditional compilation
- Add support for logger, monitoring, database, and network systems
- Use [[maybe_unused]] attribute to avoid compiler warnings
- Graceful degradation when subsystems are not available

The implementation uses KCENON_WITH_*_SYSTEM macros to detect
available subsystems at compile time, allowing the bootstrapper
to work with any combination of subsystems.

Part of #314
Closes #317
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.

[Task] feat: Implement service registration in unified_bootstrapper

1 participant