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: add fundamental concepts for future improvements #1385

Merged
merged 4 commits into from
Aug 13, 2023

Conversation

lgrossi
Copy link
Contributor

@lgrossi lgrossi commented Aug 11, 2023

Description

We have a long term plan to improve Canary code quality, including decoupling, refactoring and addition of tests. For that we could leverage some interesting concepts like dependency injection and messaging (command/events).

This PR introduces some fundaments that will be valuable for our long term plans.

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

@dudantas
Copy link
Member

image

Very good, just an observation, we can use boost-di directly from vpckg instead of using it manually.

@dudantas dudantas changed the title Lucas/add fundamental concepts for future improvements feat: add fundamental concepts for future improvements Aug 12, 2023
@lgrossi
Copy link
Contributor Author

lgrossi commented Aug 12, 2023

image

Very good, just an observation, we can use boost-di directly from vpckg instead of using it manually.

Nice one, I couldn't find it before, but I do prefer it to be done via vcpkg. I've added it to the PR.

@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch from f778ca0 to dc3e8e6 Compare August 12, 2023 09:26
@lgrossi lgrossi mentioned this pull request Aug 12, 2023
5 tasks
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch 10 times, most recently from c822e50 to 0c63d7a Compare August 12, 2023 18:06
Messaging is a powerful concept that can be used to encapsulate and isolate code behaviors as commands and events.

This commit introduces the concept of messaging using the eventpp library. For now the events/commands are not used, the concept will be explored further in future PRs.
Dependency Injection (DI) is a powerful technique used to decouple classes from its dependencies. This improves our ability to isolate and encapsulate code, as well as centralise and standardise the definition of dependencies.

This commit introduces dependency injection using the BoostDI library and an empty template of a container, to be extended and used in future commits.
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch 3 times, most recently from 032bd42 to 1677d22 Compare August 12, 2023 19:09
Currently we use SPDLOG for logging. However, we use SPDLOG macros directly all over the place. Although it's quite handy, it makes our code very attached to SPDLOG and hard to abstract logging away for tests and others.

Aiming to improve that, we are abstracting logging into an interface ILogger and adding a SpdLog implementation of this interface.

We are also defining SpdLog as the default implementation of ILogger in our DI, so that everything using DI to inject logger will always get SpdLog as default.
@lgrossi lgrossi force-pushed the lucas/add-fundamental-concepts-for-future-improvements branch from 1677d22 to 7648476 Compare August 12, 2023 19:47
@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 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@lgrossi lgrossi merged commit 82df659 into main Aug 13, 2023
@lgrossi lgrossi deleted the lucas/add-fundamental-concepts-for-future-improvements 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.

4 participants