Skip to content

[Refactor] Architecture & SRP audit across core.next: single responsibility, naming, and package partitioning #643

Closed

Description

@remiceres

Summary

Perform a systematic architectural and design audit across the core.next module to ensure adherence to the Single Responsibility Principle (SRP), clean naming conventions, modular decomposition, and cohesive package partitioning.

Objectives & Scope

1. Single Responsibility Principle (SRP)

  • Audit classes, interfaces, and records across core.next to verify that each component has one single, well-defined reason to change.
  • Identify oversized coordinator classes or classes mixing data structures, execution logic, and I/O or state management.
  • Extract cohesive helper abstractions, strategies, or immutable records where responsibilities overlap.

2. Naming Conventions & Semantics

  • Ensure class, interface, method, and variable names reflect domain semantics unambiguously without misleading or historical jargon.
  • Harmonize terminology across modules (e.g. Statement vs Triple vs Quad, Store vs Storage, Producer vs Executor).
  • Verify interface and implementation symmetry (*Operations, *Factory, *Snapshot, *Registry).

3. Granularity & Modular Decomposition

  • Evaluate method and class granularity: prevent god-classes and premature over-fragmentation.
  • Ensure proper separation between public SPI contracts (api), internal SPI abstractions (spi), and concrete implementations (impl).
  • Confirm encapsulation: verify package-private visibility for internal implementation details to minimize exposed API surface.

4. Package Structure & Architectural Partitioning

  • Review package distribution across sub-domains:
    • fr.inria.corese.core.next.data: RDF 1.1 value factory, models, literals, IRIs.
    • fr.inria.corese.core.next.storage: InMemoryStatementStore, indexes, concurrency, snapshots, transactions.
    • fr.inria.corese.core.next.query: SPARQL compilation, planning, cost-based ordering, execution pipeline.
    • fr.inria.corese.core.next.io: parsers, serializers, streaming readers, content negotiation.
  • Eliminate circular package dependencies and ensure architectural boundary enforcement passes (NextModuleBoundaryTest).

Acceptance Criteria

  • Comprehensive audit performed across core.next.* packages.
  • Identified SRP violations or naming ambiguities refactored or tracked with targeted follow-up PRs.
  • 0 SonarLint issues (cognitive complexity < 15, clean typing, boy scout compliance).
  • Architectural boundary constraints in NextModuleBoundaryTest remain 100% compliant.
  • 100% test pass rate across all existing unit tests and W3C conformance suites.

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. added
    refactoringInternal code restructuring and architecture cleanup
    on Oct 22, 2026
  3. remiceres commented on Oct 26, 2026

    @remiceres
    ContributorAuthor

    Clôture de l'Issue #643 – Bilan des 4 Chantiers

    Toutes les étapes du refactoring architectural et SRP de core.next ont été menées à bien et mergées dans feature/corese-next :

    1. Partie 1 (Contrat & Façade) : Découplage de l'interface publique Query vis-à-vis de l'implémentation interne et introduction de PreparedQueryPlan (PR [Refactor] Architecture, contracts and ergonomics audit (Part 2: Query API & Repository) (#643) #646).
    2. Partie 2 (Compilateur d'expressions & AST) : Isolation de CoreseAstQueryBuilder, extraction de compilateurs dédiés (Construct, Describe, Modifier, Where), élimination des dépendances circulaires AST (PR fix(javadoc): resolve 4 warnings in TransactionManager and data packa… #647).
    3. Partie 3 (KGRAM SRP & Solution Aggregation) : Extraction de GroupAggregator hors de Mappings, découplage d'ExecutionSession, purge de classes mortes (PR [Refactor] Architecture, contracts and ergonomics audit (Part 3: Engine SRP decomposition & dead code purge) (#643) #648).
    4. Partie 4 (Engine Query Plan & Variable Layout) : Extraction de VariableLayout hors de Query, renommage d'engine.Query en QueryPlan pour supprimer toute collision avec l'API publique (PR refactor(engine): extract VariableLayout and rename engine Query to QueryPlan (#643) #649).
    • Qualité & Intégrité : 0 alerte SonarLint, 100 % de tests unitaires passants (4 880+ tests), barrières d'architecture vérifiées par NextModuleBoundaryTest.
    • Statut Projet GitHub v2 : Déplacé vers Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

refactoringInternal code restructuring and architecture cleanup

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions