-
Notifications
You must be signed in to change notification settings - Fork 5
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
Remove loadConfiguration where it is possible #276
Conversation
|
af4d746
to
bcf9d6b
Compare
I have removed all loadConfiguration() methods from the modules and replaced them with loadManualConfiguration(). Also I removed manual configuration for fields that can be configured using annotations. |
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.
See my comments.
s-pipes-modules/module-rdf4j/src/main/java/cz/cvut/spipes/modules/Rdf4jDeployModule.java
Outdated
Show resolved
Hide resolved
...odule-sparql-endpoint/src/main/java/cz/cvut/spipes/modules/ApplyConstructAbstractModule.java
Outdated
Show resolved
Hide resolved
...in/java/cz/cvut/spipes/modules/ApplyConstructWithChunkedValuesAndScrollableCursorModule.java
Outdated
Show resolved
Hide resolved
...modules/module-sparql-endpoint/src/main/java/cz/cvut/spipes/modules/RetrieveGraphModule.java
Show resolved
Hide resolved
s-pipes-modules/module-nlp/src/main/java/cz/cvut/spipes/modules/SUTimeModuleNew.java
Show resolved
Hide resolved
...modules/module-sparql-endpoint/src/main/java/cz/cvut/spipes/modules/DownloadGraphModule.java
Show resolved
Hide resolved
s-pipes-modules/module-tarql/src/main/java/cz/cvut/spipes/modules/TarqlModule.java
Outdated
Show resolved
Hide resolved
...es-modules/module-text-analysis/src/main/java/cz/cvut/spipes/modules/TextAnalysisModule.java
Outdated
Show resolved
Hide resolved
...odule-sparql-endpoint/src/main/java/cz/cvut/spipes/modules/ApplyConstructAbstractModule.java
Outdated
Show resolved
Hide resolved
...in/java/cz/cvut/spipes/modules/ApplyConstructWithChunkedValuesAndScrollableCursorModule.java
Outdated
Show resolved
Hide resolved
...es-modules/module-text-analysis/src/main/java/cz/cvut/spipes/modules/TextAnalysisModule.java
Outdated
Show resolved
Hide resolved
...modules/module-sparql-endpoint/src/main/java/cz/cvut/spipes/modules/RetrieveGraphModule.java
Show resolved
Hide resolved
@blcham
|
682c505
to
114243c
Compare
114243c
to
80fab41
Compare
I’m not sure why, but when I try to test locally with One more thing I wanted to discuss: how can I easily test all the modules that I modified in the current ticket? I want to be sure that I didn’t break anything and that everything works as expected. Some modules don’t have tests at all. Maybe it would be a good idea to implement tests for these modules in a separate ticket before I continue with the current ticket? |
Also, I’m stuck on the problem of removing manual configuration for the classes that call super.loadConfiguration(). I will try to explain. There is module class ApplyConstructAbstractModule extends AnnotatedAbstractModule Some modules extend this class to have configured fields, such as constructQueries, isReplace, and parseText. for example this module: class ApplyConstructWithChunkedValuesModule extends ApplyConstructAbstractModule As it was before, the ApplyConstructWithChunkedValuesModule called super.loadConfiguration(), which was overridden in ApplyConstructAbstractModule to manually configure the fields. However, when I remove this overriding method from the parent, I’m unsure how to configure it from the child class using annotations. If we call super.loadConfiguration() from the child, it will see that the parent did not implement it and will then call loadConfiguration from AnnotatedAbstractModule, which only configures the child class. Therefore, I’m not sure how to resolve the problem without manually configuring all the fields in ApplyConstructAbstractModule within the loadManualConfiguration() method and then calling it from the child modules. |
Maybe you have local changes there, try this to be sure:
Yes, that is also option. But how about reimplementing loadConfiguration() to process also parent classes? Would it solve the issue? |
Thank you for the idea! It should be better than doing it manually. |
a700814
to
c9e1441
Compare
Document the `loadConfiguration` method in `AnnotatedAbstractModule`.
b1d6e59
to
f6688d3
Compare
…onfiguration() in all methods that use it. Refactor the code.
f6688d3
to
b92e542
Compare
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.
Almost done, see my comments
s-pipes-core/src/main/java/cz/cvut/spipes/modules/AnnotatedAbstractModule.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/modules/AnnotatedAbstractModule.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/modules/AnnotatedAbstractModule.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/modules/AnnotatedAbstractModule.java
Outdated
Show resolved
Hide resolved
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.
LGTM, you can merge it without change, just see my comment about recursion
Resolves #274.
I removed
loadConfiguration()
where possible ins-pipes-modules
. However, there are three main reasons why I couldn't remove it from some other modules: