Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 10, 2025

Summary

This PR implements the NamedTypesDecorator that serves as a universal decorator implementing both ILinks and INamedTypes interfaces, as requested in issue #23.

Key Features:

  • Dual Interface Implementation: Implements both ILinks<TLinkAddress> and INamedTypes<TLinkAddress>
  • Complete Naming Operations: Supports setting, getting, and removing names for link addresses
  • Automatic Cleanup: Names are automatically removed when links are deleted
  • External Reference Support: Uses external references for proper name mapping
  • Comprehensive Testing: Full test suite with 8 test cases covering all functionality

Implementation Details:

  • INamedTypes Interface: Defines the contract for naming operations (GetName, SetName, GetByName, RemoveName)
  • NamedTypesDecorator: Universal decorator extending LinksDecoratorBase and implementing INamedTypes
  • Integration: Leverages existing UnicodeStringStorage and NamedLinks infrastructure
  • Tracing Support: Optional tracing for debugging and monitoring

Test Coverage:

  • Interface compliance verification
  • Name setting and retrieval
  • Name lookup by string
  • Name removal functionality
  • Name overwriting behavior
  • Automatic cleanup on link deletion
  • Graceful handling of non-existent names/links

Files Added:

  • Foundation.Data.Doublets.Cli/INamedTypes.cs - Interface definition
  • Foundation.Data.Doublets.Cli/NamedTypesDecorator.cs - Main implementation
  • Foundation.Data.Doublets.Cli.Tests/NamedTypesDecoratorTests.cs - Comprehensive test suite

Test Results:

Passed!  - Failed: 0, Passed: 8, Skipped: 0, Total: 8

All tests pass successfully, confirming the implementation meets the requirements.


Fixes #23

🤖 Generated with Claude Code

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

Issue: #23
@konard konard self-assigned this Sep 10, 2025
konard and others added 2 commits September 10, 2025 16:36
- Add INamedTypes interface defining naming operations
- Add NamedTypesDecorator implementing both ILinks and INamedTypes
- Add comprehensive test suite for NamedTypesDecorator
- Supports setting, getting, and removing names for link addresses
- Integrates with existing UnicodeStringStorage and NamedLinks infrastructure

Fixes #23

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

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Add implementation of universal NamedTypes decorator for ILinks Add implementation of universal NamedTypes decorator for ILinks Sep 10, 2025
@konard konard marked this pull request as ready for review September 10, 2025 13:51
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.

Add implementation of universal NamedTypes decorator for ILinks

2 participants