-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Replace new instantiation of BuildInfo with calls to Injector #11954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - you decided against constructor-based injection, but sued the Injector
directly? If it is OK for you, it is OK for me!
I have no hard opinion on this atm. Probably think about some hours. Will come back to this later |
I think, constructor-based injection will increase the code, but the dependencies are explicit. In constract, with the injector, one "just" needs to search for class usages with an Injector... Using the example of |
In general, constructor based dependency injection is preferable because you can better test it and it's more explicit. For example, spring also recommends ctor based injection |
The build of this PR is available at https://builds.jabref.org/pull/11954/merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like keeping the preferences together. - Some code still needs to be adapted to use
importerPreferences.getApiKey(getName())
instead of
Injector.instantiateModelOrService(BuildInfo.class).semanticScholarApiKey
because the keys are now provided by importerPreferences.getApiKey
...a/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/SemanticScholarFetcher.java
Outdated
Show resolved
Hide resolved
Then what is the purpose of DI framework? Like the one we use? |
Afterburner is not a di framework. |
The build of this PR is available at https://builds.jabref.org/pull/11954/merge. |
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
…#11954) * Replace new instantiation of BuildInfo with calls to Injector * Extract call to default keys out of fetchers * Inject buildInfo * Integrate SemanticScholarFetcher * Integrate IEEE * Add warning log * Adapt devdocs * Integrate SpringerLink * Add comment * Enhance doc * Enhance doc
…#11954) * Replace new instantiation of BuildInfo with calls to Injector * Extract call to default keys out of fetchers * Inject buildInfo * Integrate SemanticScholarFetcher * Integrate IEEE * Add warning log * Adapt devdocs * Integrate SpringerLink * Add comment * Enhance doc * Enhance doc
…#11954) * Replace new instantiation of BuildInfo with calls to Injector * Extract call to default keys out of fetchers * Inject buildInfo * Integrate SemanticScholarFetcher * Integrate IEEE * Add warning log * Adapt devdocs * Integrate SpringerLink * Add comment * Enhance doc * Enhance doc
closes https://github.com/JabRef/jabref-issue-melting-pot/issues/604
also removes some telemetry artifacts
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)