Skip to content

[Refactor] Consolidate Bootstrap Generation Logic #183

@astrogilda

Description

@astrogilda

Is your feature request related to a problem? Please describe.
There are 15+ duplicate implementations of _generate_samples_single_bootstrap across different bootstrap modules, leading to code duplication and maintenance challenges.

Describe the solution you'd like
Implement a unified approach using either:

  1. Template Method Pattern: Create an abstract base method with customizable hooks
  2. Strategy Pattern: Use composition to inject specific bootstrap generation strategies

The solution should:

  • Extract common bootstrap generation logic into the base class
  • Allow subclasses to customize specific steps without duplicating the entire method
  • Maintain backward compatibility with existing API

Describe alternatives you've considered

  • Mixin classes for shared functionality
  • Function composition with decorators
  • Utility module with shared functions

Additional context
Benefits of consolidation:

  • DRY (Don't Repeat Yourself) principle compliance
  • Easier maintenance and bug fixes
  • Consistent behavior across all bootstrap types
  • Reduced testing burden

Part of codebase quality improvement initiative identified in refactoring analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions