refactor(dds): UserEndpointManager の責務を分離#104
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
UserEndpointManager(411 行) を責務ごとに 3 つのコンポーネントに分離し、public API を一切変更せずに contract 単位の単体テストを追加します。背景
UserEndpointManagerはローカル user endpoint の登録状態とマッチングを担う中心的なコンポーネントだったが、内部に lock 保持・receiver 副作用・match 判定・locator 解決が混在しており、EditMode / .NET unit test で挙動を絞りにくかった。\nドメイン participant のテスタビリティ向上 (
docs/superpowers/specs/2026-06-30-domain-participant-testability-design.md) と同じパターン (interface 抽出 + 純関数ヘルパー + 副作用分離) を適用する。設計
詳細:
docs/superpowers/specs/2026-06-30-user-endpoint-manager-testability-design.mdアーキテクチャ
EndpointRegistryEndpointMatcherIEndpointReceiver+ParticipantRtpsReceiverAdapterParticipantRtpsReceiverへの register / unregister 呼び出しを隠蔽UserEndpointManager(改修)コミット
3e9c660refactor(dds): IEndpointReceiver interface と adapter を追加fb8479brefactor(dds): EndpointMatcher を抽出 (match 判定 + locator 解決)b38c104refactor(dds): EndpointRegistry を抽出 (状態 holder)171bda5refactor(dds): UserEndpointManager を Registry/Matcher/Receiver へ委譲影響範囲
新規ファイル (
src/rosettadds/Dds/配下):EndpointRegistry.cs(+.meta)EndpointSnapshot.cs(+.meta)LocalWriter.cs(+.meta)LocalReader.cs(+.meta)MatchDecision.cs(+.meta)EndpointMatcher.cs(+.meta)IEndpointReceiver.cs(+.meta)ParticipantRtpsReceiverAdapter.cs(+.meta)変更ファイル:
UserEndpointManager.cs— 内部実装を委譲DomainParticipant.cs— adapter を渡すよう 1 行変更UserEndpointManagerTests.cs(コンストラクタ呼び出しのみ更新)新規テストファイル (
tests/rosettadds.Tests/Dds/配下):EndpointRegistryTests.cs(10 tests)EndpointMatcherTests.cs(18 tests)UserEndpointManagerRefactoredTests.cs(6 tests)FakeEndpointReceiver.cs(fake impl)ParticipantRtpsReceiverAdapterTests.cs(5 tests)非目標
UserEndpointManager/DomainParticipantの public API 変更なしParticipantRtpsReceiverの interface 化なし (adapter で wrap のみ)DiscoveryDbの interface 化なし受け入れ基準
UserEndpointManagerTests.csの 2 件が緑のままPublisherBatchTestsを除く)UserEndpointManagerの public API への破壊的変更なしDomainParticipantの public API への破壊的変更なしcheck_unity_meta.shクリーン