Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 12, 2025

Summary

• Added IDynamicLinks interface to enable runtime polymorphism using virtual method dispatch
• Modified ILinks<TLinkAddress, TConstants> to extend IDynamicLinks for backward compatibility
• Created LinksBase abstract class as foundation for concrete dynamic implementations
• Maintains all existing functionality while adding true dynamic polymorphism support

Changes Made

  • IDynamicLinks.cs: New interface with object-based parameters for runtime type flexibility
  • ILinks.cs: Updated to extend IDynamicLinks while preserving generic static polymorphism
  • LinksBase.cs: Abstract base class implementing IDynamicLinks for easy inheritance

Implementation Details

The solution follows the pattern shown in the referenced C++ examples:

  • Dynamic polymorphism: IDynamicLinks uses object types and virtual dispatch like IFactory.h
  • Static polymorphism: Existing ILinks<T,C> maintains compile-time type safety like CFactory.h
  • Compatibility: All existing code continues to work unchanged

This enables both approaches to coexist - developers can use the strongly-typed generic interface for performance-critical code and the dynamic interface for scenarios requiring runtime polymorphism.

Test Plan

  • All existing tests pass
  • Code builds without errors
  • Backward compatibility maintained
  • New interfaces compile and integrate correctly

🤖 Generated with Claude Code


Resolves #81

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

Issue: #81
@konard konard self-assigned this Sep 12, 2025
• Created IDynamicLinks interface for runtime polymorphism
• Modified ILinks to extend IDynamicLinks for backward compatibility
• Added LinksBase abstract class as foundation for dynamic implementations
• Maintains existing generic static polymorphism while enabling dynamic dispatch

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Make ILinks a true interface for dynamic polymorphism Make ILinks a true interface for dynamic polymorphism Sep 12, 2025
@konard konard marked this pull request as ready for review September 12, 2025 23:55
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.

Make ILinks a true interface for dynamic polymorphism

2 participants