You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate the multiple adapter utility classes (typed_adapter, smart_adapter, adapter_base, etc.) into a single, generic adapter template that handles all use cases through template specialization and concepts.
Background (Why)
Multiple adapter classes exist with overlapping functionality
Users must choose between similar adapters with subtle differences
Each adapter has similar boilerplate code
Kent Beck's "Fewest Elements" rule: minimize API surface
Adding new adapter features requires changes to multiple classes
Current adapter proliferation:
// Current: Multiple similar adapters
typed_adapter<T> // Type-safe adapter
smart_adapter<T> // Smart pointer aware
adapter_base // Base class for custom adapters
callback_adapter<T> // For callback-based APIs
Summary
Consolidate the multiple adapter utility classes (
typed_adapter,smart_adapter,adapter_base, etc.) into a single, generic adapter template that handles all use cases through template specialization and concepts.Background (Why)
Current adapter proliferation:
Scope (What)
Current State (Multiple Adapters)
Proposed State (Single Generic Adapter)
Backward Compatibility
Impact Analysis (Where)
adapters/adapter_base.hadapter<T>adapters/typed_adapter.hadapter<T>adapters/smart_adapter.hadapter<shared_ptr<T>>adapters/callback_adapter.hadapters/adapter.hImplementation Plan (How)
Phase 1: Core Adapter
patterns/adapters/adapter.hadapter_traitsprimary templateshared_ptrspecializationunique_ptrspecializationadapter<T>templatePhase 2: Features
as<U>()Phase 3: Migration
Phase 4: Cleanup
Acceptance Criteria
adapter<T>template handles all use casesLabels
refactorcode-qualityapi-design