# larnhold/madmp-assessment architecture

> Architecture diagram of the GitHub repository larnhold/madmp-assessment, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/larnhold/madmp-assessment
- Repository: https://github.com/larnhold/madmp-assessment

## Overview

##### Main components
- DMP Loader – Responsible for loading DMPs and turning them into a normalized form (found in the case-study and sdk packages).
- DMP Harvester Service – Provides access to DMPs and their resolved, contextual information (implemented in the core module).
- Data Store – Offers centralized access to store artifacts (present in both core and case-study implementations).
- DMP Indicator Service – The coordinator that processes DMP evaluations and generates quality indicators (core components).
- Context Loader – Retrieves external contextual data referenced in a DMP (available in the case-study package with several plugins like OpenAire, FAIRSharing, re3Data).
- Evaluator – Implements quality measurement logic for various dimensions (the evaluators are present in the case-study package again with separate evaluators such as completeness, compliance, feasibility, quality-of-actions, etc.).
- SDK Module – This module defines the common interfaces and data structures to bridge the core and case-study modules. It ensures that changes in one module do not break the other’s expected interfaces.
- External Services – Notably, the framework integrates with systems like the F-UJI FAIR evaluator (accessible via Docker Compose).

##### Module boundaries
- Core Module: Contains generic services (harvester, indicator, plugin loader) and configuration that is independent of the specific use case.
- Case-Study Module: Contains use case–driven implementations of loaders, evaluators, and data store configurations. It is adapted to DCS (and Science Europe) and uses multiple evaluators.
- SDK Module: Provides connectivity via common API definitions and shared models between core and case-study.

##### Relationships and interactions
- The DMP Loader (in the case-study module) receives raw DMP data from external or internal sources. This module may interact with the Context Loader to resolve referenced entities.
- The DMP Harvester Service (in core) gathers and aggregates both the DMP content provided by the loader and external contextual data.
- The Evaluators (in case-study) process the normalized DMPs and compute quality metrics. Their results are published back into the system.
- The DMP Indicator Service (in core) coordinates the process and stores the output in a Data Store (again, implemented in a use-case–specific way in case-study).
- Communication between core and case-study components is streamlined via the SDK interfaces and data structures.

##### Architectural patterns and design principles
- Modularity: Separation of concerns is achieved by dividing the system into clearly defined modules (core, case-study, sdk). This eases maintenance and enhances clarity.
- Plugin Architecture: The evaluator components, context loaders, and DMP loaders appear to use a plugin-based approach (e.g., use of PluginLoader classes) that allow flexible addition of new evaluators or data providers.
- Client-Server Model: The application is a Spring Boot service with API endpoints (e.g., Swagger is provided).
- Integration via standardized interfaces (SDK), allowing decoupling between core functionality and specific implementations.

## Diagram (Mermaid)

```mermaid
graph TD
  %% Case-Study Module
  subgraph "Case-Study Module"
    Loader["DMP Loader"]:::casestudy
    ContextLoader["Context Loader"]:::casestudy
    CS_DataStore["Data Store"]:::casestudy
    Evaluator["Evaluator Plugins"]:::casestudy
    CS_Config["Config & Plugin Loader (CS)"]:::casestudy
  end

  %% Core Module
  subgraph "Core Module"
    HarvesterService["DMP Harvester Service"]:::core
    IndicatorService["DMP Indicator Service"]:::core
    Core_Config["Config & Plugin Loader (Core)"]:::core
  end

  %% SDK Module
  subgraph "SDK Module"
    SDKInterface["SDK Interface Layer"]:::sdk
  end

  %% External and Client
  subgraph "External & Client"
    ExternalFUJI["F-UJI FAIR Evaluator"]:::external
    Swagger["Swagger UI"]:::client
  end

  %% Relationships between modules and components
  Loader -->|"providesData"| HarvesterService
  ContextLoader -->|"contextResolution"| HarvesterService
  HarvesterService -->|"aggregatesData"| IndicatorService
  Evaluator -->|"qualityMetrics"| IndicatorService

  %% SDK integration between modules
  Loader <-->|"sdkIntegration"| SDKInterface
  CS_DataStore <-->|"sdkIntegration"| SDKInterface
  HarvesterService <-->|"sdkIntegration"| SDKInterface
  Evaluator <-->|"sdkIntegration"| SDKInterface

  %% External service integration
  IndicatorService -->|"callsFAIR"| ExternalFUJI
  Evaluator -->|"callsFAIR"| ExternalFUJI

  %% Client interaction
  Swagger -->|"APIcalls"| HarvesterService

  %% Styling Classes
  classDef core fill:#ADD8E6,stroke:#000,stroke-width:2px;
  classDef casestudy fill:#90EE90,stroke:#000,stroke-width:2px;
  classDef sdk fill:#FFA500,stroke:#000,stroke-width:2px;
  classDef external fill:#F08080,stroke:#000,stroke-width:2px;
  classDef client fill:#D3D3D3,stroke:#000,stroke-width:2px;

  %% Click Events
  click Loader "https://github.com/larnhold/madmp-assessment/blob/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/dmp/MaDMPJsonJacksonLoaderImpl.kt"
  click Loader "https://github.com/larnhold/madmp-assessment/tree/main/sdk/src/main/kotlin/org/arnhold/sdk/dmpLoader"
  
  click HarvesterService "https://github.com/larnhold/madmp-assessment/blob/main/core/src/main/kotlin/org/arnhold/evaluator/harvester/dmpProvider/DmpProviderServiceImpl.kt"
  click HarvesterService "https://github.com/larnhold/madmp-assessment/blob/main/core/src/main/kotlin/org/arnhold/evaluator/harvester/DataProviderController.kt"
  
  click CS_DataStore "https://github.com/larnhold/madmp-assessment/blob/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/store/DataStoreServiceImpl.kt"
  click CS_DataStore "https://github.com/larnhold/madmp-assessment/blob/main/sdk/src/main/kotlin/org/arnhold/sdk/store/DataStoreService.kt"
  
  click IndicatorService "https://github.com/larnhold/madmp-assessment/blob/main/core/src/main/kotlin/org/arnhold/evaluator/indicator/IndicatorServiceController.kt"
  click IndicatorService "https://github.com/larnhold/madmp-assessment/blob/main/core/src/main/kotlin/org/arnhold/evaluator/indicator/evaluationManager/EvaluationManagerServiceImpl.kt"
  
  click ContextLoader "https://github.com/larnhold/madmp-assessment/blob/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/context/openAire/OpenAireContextLoaderPlugin.kt"
  click ContextLoader "https://github.com/larnhold/madmp-assessment/blob/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/context/FAIRSharing/FAIRSharingService.kt"
  click ContextLoader "https://github.com/larnhold/madmp-assessment/blob/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/context/re3Data/Re3DataContextLoaderPlugin.kt"
  
  click Evaluator "https://github.com/larnhold/madmp-assessment/tree/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/evaluation/"
  
  click SDKInterface "https://github.com/larnhold/madmp-assessment/tree/main/sdk/"
  
  click ExternalFUJI "https://github.com/larnhold/madmp-assessment/blob/main/docker/docker-compose.yml"
  click ExternalFUJI "https://github.com/larnhold/madmp-assessment/blob/main/case-study/src/main/kotlin/org/arnhold/dmpeval/casestudy/evaluation/qualityOfActionsCategoryEvaluators/FujiServiceImpl.kt"
```
