Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 14, 2025

Summary

Refactor the nested Matcher class from Sequences.cs by moving it into separate files and splitting it into distinct classes for Full and Partial matching operations.

Changes Made

  • Extracted nested Matcher class from Sequences.cs (previously ~180 lines starting at line 631)
  • Split into specialized classes for better separation of concerns:
    • SimpleFullMatcher - handles full sequence matching operations
    • SimplePartialMatcher - handles partial sequence matching operations
    • SimpleSequenceMatcherBase - shared base functionality and common patterns
    • ISequenceMatcher - common interface for polymorphic usage
  • Updated Sequences.cs to use SimpleFullMatcher instead of the nested class
  • Added SequencesOptions basic implementation to resolve dependencies
  • Maintained all original functionality while improving code organization

Architecture Improvements

  • Separation of Concerns: Full and partial matching logic now in separate classes
  • Single Responsibility: Each matcher class has a focused purpose
  • Interface Segregation: Common interface allows polymorphic usage
  • Code Reusability: Shared base class reduces code duplication
  • Maintainability: Smaller, focused files easier to maintain and test

Files Created

  • Sequences/ISequenceMatcher.cs - Interface for sequence matching operations
  • Sequences/SimpleSequenceMatcherBase.cs - Base class with shared functionality
  • Sequences/SimpleFullMatcher.cs - Full matching implementation
  • Sequences/SimplePartialMatcher.cs - Partial matching implementation
  • Sequences/SequencesOptions.cs - Basic options class

Test Plan

  • Code compiles successfully (with expected interface implementation warnings)
  • All original matching logic preserved in separate classes
  • Sequences.cs updated to use new SimpleFullMatcher
  • Maintained all method signatures and functionality

Fixes #123

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #123
@konard konard self-assigned this Sep 14, 2025
…rtial matchers

- Extract nested Matcher class from Sequences.cs (previously ~180 lines at line 631)
- Split into separate classes for better separation of concerns:
  * SimpleFullMatcher - handles full sequence matching
  * SimplePartialMatcher - handles partial sequence matching
  * SimpleSequenceMatcherBase - shared base functionality
  * ISequenceMatcher - common interface
- Maintain all original functionality while improving code organization
- Update Sequences.cs to use new SimpleFullMatcher instead of nested class
- Add basic SequencesOptions to resolve dependencies

Fixes #123

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Move this class into separate file and split it to multiple different classes (for Full and Partial matchers) Refactor: Move Matcher class to separate files and split into Full/Partial matchers Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 05:10
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.

Move this class into separate file and split it to multiple different classes (for Full and Partial matchers)

2 participants