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

DI POC #2108

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

DI POC #2108

wants to merge 1 commit into from

Conversation

illuque-iov
Copy link

POC implementing a simple Dependency Injection system for RSKj.

Description

POC implementing a simple Dependency Injection system for RSKj. This system is not invasive, meaning that it can be applied for the dependencies we consider relevant while leaving others aside (no changes). For showcasing purposes, co.rsk.net.handler.quota.TxQuotaChecker is being injected in co.rsk.core.bc.TransactionPoolImpl#TransactionPoolImpl using this new mechanism.

The feature is yet a draft, subject to changes or bugs. It needs thorougher testing before considering it production ready, although it seems not very invasive or potentially problematic.

Motivation and Context

Injecting dependencies via constructor is sometimes tedious and affects multiple nested classes. This PR aims to simplify this.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

@sonarcloud
Copy link

sonarcloud bot commented Aug 22, 2023

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 1 Code Smell

71.7% 71.7% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.16) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant