From c2337fbbbabf77c12127c36d4dc3a5205ab7198c Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Thu, 11 Aug 2022 14:13:29 +0200 Subject: [PATCH] docs: decision record about project structure review (#1803) * docs: decision record about project structure review * pr remarks --- .../README.md | 55 +++++++++++++++++++ docs/developer/decision-records/README.md | 3 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 docs/developer/decision-records/2022-08-09-project-structure-review/README.md diff --git a/docs/developer/decision-records/2022-08-09-project-structure-review/README.md b/docs/developer/decision-records/2022-08-09-project-structure-review/README.md new file mode 100644 index 00000000000..30ddeb969dd --- /dev/null +++ b/docs/developer/decision-records/2022-08-09-project-structure-review/README.md @@ -0,0 +1,55 @@ +# Title of the Decision Record + +## Decision + +The project structure needs to be changed, to follow a "component" structure. + +## Rationale + +Currently it's hard for a new developer or adopter to understand the different components of the application are composed, in particular +`control-plane`, `data-plane`, `federated-catalog` etc... + +> A component is a particular EDC combination of dependencies that respond to a particular need, e.g.: `control-plane`, `data-plane`, `data-plane-selector`. +This would help developers to orient themselves in the codebase more easily and separate responsibilities in a better way. + +The goal of this review is to have a clearer structure. + +## Approach + +### Spi +The `spi` module should be refactored as: +``` +spi/common/catalog-spi +spi/common/core-spi +spi/common/transport-spi +spi/common/web-spi +spi/control-plane +spi/control-plane/asset-spi +spi/control-plane/contract-spi +spi/control-plane/policy-spi +spi/control-plane/transfer-spi +spi/data-plane/data-plane-spi +spi/data-plane/data-plane-selector-spi +``` +Every component should have its own `spi` module, then other "common" spi could exist as well (like `core`, `catalog`, `transport` and `web`) + +Some details: +- the `asset-spi` would be extracted from the `core-spi` +- the `*Service` interfaces should be moved to the `control-plane/*-spi` + +### Core +The responsibility of the core modules is to provide a working base version of every component, so they should provide +a default implementation for every interface present in the relative `spi` module, so these three modules will be introduced: +- `control-plane-core`: would contain all the default implementations of the stores and the services and an extension that register them as default +- `data-plane-core`: is the current `data-plane-framework` extension, will register all the default implementations +- `data-plane-selector-core`: is the current `selector-core` module + +All of them should extend the `base-core` module. The `defaults` module would probably disappear (replaced by the `-core` ones) + +### Extensions + +This component separation will be put in place also in the `extensions` folder, as some extensions are needed only by one of the components, for example: +- `control-plane`: data management api, provisioners (s3, blobstorage, http...), "stores" sql/cosmos implementations (for assets, contracts, transfer process, policies...), data-plane-selector client, ... +- `data-plane`: implementations of the source/sink interfaces like `data-plane-http`, `data-plane-s3`, etc.., data plane specific api (`data-plane-api` module) +- `data-plane-selector`: implementations of the `DataPlaneInstanceStore` +- common (needed by more than one component): observability api, vault, configuration, http, loggers, iam, ... \ No newline at end of file diff --git a/docs/developer/decision-records/README.md b/docs/developer/decision-records/README.md index 0ca7e4295c6..7f0ac51d8d3 100644 --- a/docs/developer/decision-records/README.md +++ b/docs/developer/decision-records/README.md @@ -28,4 +28,5 @@ - [2022-07-27 Custom DTO validation](2022-07-27-custom-dto-validation/README.md) - [2022-07-28 "Provisioning Requested" TransferProcess new state](2022-07-28-transfer-process-new-state/README.md) - [2022-08-01 Entity Timestamp](2022-08-01-entity-timestamp/README.md) -- [2022-08-04 Automated Documentation](developer/decision-records/2022-08-04-documentation-automation/README.md) +- [2022-08-04 Automated Documentation](2022-08-04-documentation-automation/README.md) +- [2022-08-09 Project structure review](2022-08-09-project-structure-review/README.md)