openproject icon indicating copy to clipboard operation
openproject copied to clipboard

[WIP] Reorganizes the StorageInteraction code plus other improvements

Open mereghost opened this issue 1 year ago • 0 comments

THIS IS AN EXPERIMENT

What?

We have a bunch of namespaces under Storages but some don't bring much clarity on what is their intended purpose or we gained new insight on the necessities for different service providers.

Why?

All storage supporting code lives under Peripherals (under the common/storages/ folder) and has become kind of that practical drawer where you just throw anything you wanna "hide" (under the guise of organizing) and it is slowing becoming a mess.

How?

First I'm introducing the Adapters namespace (under common/storage/adapters) where the code that is tailored goes (adapters/nextcloud, adapters/one_drive).

Each adapter structure is identical (in an ideal world) with the following namespaces / folders:

  • Commands: all commands (requests that makes changes to the remote service) go here
  • Queries: all queries (requests that only fetch remote information) go here
  • Contracts: contracts to be used with the Storage models
  • Support: any support code required for that service provider

The Adapters namespace will also have supporting code to it - Authentication Strategies, Specific Errors and also Objects defining the shape the results (success/failure) for all the required Commands and Queries.

The adapters folder/namespace also houses all the pieces used by the adapters (authentication, value objects etc)

mereghost avatar Jun 13 '24 09:06 mereghost