Skip to content

Extract unbounded read model capability to separate interface#25

Merged
vanrogu merged 1 commit intodevelopfrom
claude/hide-unbounded-queries-8X0Il
Feb 12, 2026
Merged

Extract unbounded read model capability to separate interface#25
vanrogu merged 1 commit intodevelopfrom
claude/hide-unbounded-queries-8X0Il

Conversation

@vanrogu
Copy link
Member

@vanrogu vanrogu commented Feb 12, 2026

Summary

Refactored the unbounded read model methods from ReadModelCapability into a dedicated UnboundedReadModelCapability interface to provide better separation of concerns and explicit opt-in for cross-context read operations.

Key Changes

  • New interface: Created UnboundedReadModelCapability<DOMAIN_EVENT_TYPE> containing the two readUnbounded() method signatures
    • Includes comprehensive JavaDoc explaining the purpose (internal dashboard/monitoring only) and usage patterns
    • Provides guidance for application developers to use bounded ReadModelCapability#read() instead
    • Documents how to explicitly extend this interface in custom bounded context definitions
  • Refactored ReadModelCapability: Removed the readUnbounded() methods and the associated TODO comment about visibility
  • Updated BoundedContextImpl: Now explicitly implements UnboundedReadModelCapability<DOMAIN_EVENT_TYPE> in addition to existing interfaces

Implementation Details

This change makes unbounded read operations opt-in at the interface level rather than hidden behind a TODO comment. Bounded contexts that need dashboard/monitoring capabilities can now explicitly declare this requirement by extending UnboundedReadModelCapability, making the intent clear and preventing accidental cross-context queries in regular application code.

https://claude.ai/code/session_012D3mi7czkMEwKXYUvi7m2s

…rface

Move readUnbounded() methods out of ReadModelCapability into a dedicated
UnboundedReadModelCapability interface so they are no longer exposed on
BoundedContext by default. Dashboard code can opt in by extending the new
interface in a custom bounded context type, leveraging the existing proxy
mechanism. This keeps the public API clean for application developers.

https://claude.ai/code/session_012D3mi7czkMEwKXYUvi7m2s
@vanrogu vanrogu merged commit 21cc15b into develop Feb 12, 2026
1 check failed
@vanrogu vanrogu deleted the claude/hide-unbounded-queries-8X0Il branch February 13, 2026 19:32
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.

2 participants