Skip to content

🟑 High: Break circular dependency between Curation and DataExport namespaces #120

@jas88

Description

@jas88

Summary

Circular dependency exists between Rdmp.Core.Curation and Rdmp.Core.DataExport namespaces, preventing clean architectural layering.

Evidence

Curation β†’ DataExport references:

Rdmp.Core/Curation/FilterImporting/DeployedExtractionFilterUIOptions.cs:
    using Rdmp.Core.DataExport.Data;

Rdmp.Core/Curation/FilterImporting/FilterUIOptionsFactory.cs:
    using Rdmp.Core.DataExport.Data;

Rdmp.Core/Curation/Data/IExtractionResults.cs:
    using Rdmp.Core.DataExport.Data;

DataExport β†’ Curation references:

Rdmp.Core/DataExport/Checks/GlobalsReleaseChecker.cs:
    using Rdmp.Core.Curation.Data;

Rdmp.Core/DataExport/Checks/ExtractionConfigurationChecker.cs:
    using Rdmp.Core.Curation.Data;

(Many more files...)

Impact

  • Cannot cleanly separate concerns
  • Testing becomes difficult (need both namespaces)
  • Potential for circular initialization issues
  • Prevents proper layering
  • Makes it hard to understand dependencies

Recommended Solution

Option 1: Extract Shared Interfaces

Create Rdmp.Core.Contracts assembly:

Rdmp.Core.Contracts/
β”œβ”€β”€ IExtractionResults.cs
β”œβ”€β”€ IFilterOptions.cs
└── IExtractionConfiguration.cs

Both Curation and DataExport depend on Contracts, but not on each other.

Option 2: Dependency Inversion

Move shared interfaces to Curation (the "lower" layer), have DataExport depend only on interfaces.

Option 3: Merge Namespaces

If the coupling is fundamental, consider merging into a single namespace with sub-namespaces.

Implementation Steps

  1. Identify all cross-references between namespaces
  2. Categorize as: shared interfaces, shared entities, or true coupling
  3. Extract shared interfaces to contracts assembly
  4. Update references to use interfaces
  5. Verify no remaining circular references

Labels

architecture, technical-debt

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions