Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move all globals behind di #1389

Merged
merged 3 commits into from
Aug 14, 2023
Merged

Conversation

lgrossi
Copy link
Contributor

@lgrossi lgrossi commented Aug 12, 2023

Description

Previously, we've introduced a DI container using BoostDI.

This PR now aims to move all the singletons and shared global instances behind the DI container, making sure that everyone uses a single source of truth for instanciation of shared dependencies (the container).

This is done using the inject<>() function, to reduce the effort needed. However, the desired approach is to have injection in the constructor level, to reduce the risks of mutability and inconsistencies. For now, using inject<>() is a nice step in between.

Type of change

Please delete options that are not relevant.
New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from cfd2077 to c6c97f5 Compare August 12, 2023 13:13
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch from ba4f2ea to 67ca360 Compare August 12, 2023 13:17
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from c6c97f5 to 34afb41 Compare August 12, 2023 13:22
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch from 67ca360 to 807b906 Compare August 12, 2023 13:30
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch 2 times, most recently from 4bab96f to 2caab6a Compare August 12, 2023 13:34
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch 2 times, most recently from 750b319 to 0b67e41 Compare August 12, 2023 13:54
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from 2caab6a to 66c3ce7 Compare August 12, 2023 13:55
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch from 0b67e41 to e8e24e6 Compare August 12, 2023 13:57
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch 2 times, most recently from 8bb385e to c43e465 Compare August 12, 2023 14:00
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch from e8e24e6 to 60f525e Compare August 12, 2023 16:24
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from c43e465 to a9fb3ac Compare August 12, 2023 16:25
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch 5 times, most recently from 0c63d7a to 7933279 Compare August 12, 2023 18:10
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from a9fb3ac to e163744 Compare August 12, 2023 18:11
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch 2 times, most recently from 1677d22 to 7648476 Compare August 12, 2023 19:47
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from e163744 to e89f1be Compare August 12, 2023 19:52
@lgrossi lgrossi changed the base branch from lucas/add-fundamental-concepts-for-future-improvements to main August 13, 2023 19:09
@lgrossi lgrossi force-pushed the lucas/move-all-globals-behind-di branch from e89f1be to 7739e15 Compare August 13, 2023 19:10
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@lgrossi lgrossi merged commit 08bed0c into main Aug 14, 2023
@lgrossi lgrossi deleted the lucas/move-all-globals-behind-di branch August 14, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants