CSCfi / CSCfi/rems

Think about the pattern of joining related items in services and write an ADR.

Open
#2,714 0 comments 0 reactions 0 assignees View on GitHub
Investigate Technical Debt
Dominant language
Clojure
Stars
66
Forks
28
Avg merge
7d 4h
Merged PRs (30d)
2

Description

We have various `get-xxx`, `join-xxx` and `join-dependencies` functions in our services/db layers. We should formalize a pattern from these with an ADR.

Some considerations:
- getting an entity `x` at service layer should join and enrich some dependencies `y`, e.g. organization of workflow, the handlers of the workflow (with names)
- the responsibility of fetching each `x` is in the db of `x`, also each `y` in db of `y`, but joining to a key `k` inside x, we can have helpers, and there could be a pattern we can follow
- in GraphQL we leave the responsibility to the query to specify the whole extent as a tree including fine-grained attributes for each entity
- in REST APIs there can be e.g. `$expand=user,organization` to do similar things, however, this is not so common or nice
- We can first consider how to make our internal service layer code great and reusable.
- Then we can consider implementing an autojoiner.

See also discussion at https://github.com/CSCfi/rems/pull/2706#discussion_r699954034

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.