sirix
sirix copied to clipboard
Clean architecture: Replace the `PageReadOnlyTrx` for serialization/deserialization of pages/nodes
It should not be given as a parameter to the serialize
/deserialize
methods to potentially read other data during serialization/deserialization of nodes for instance as it violates the layered architecture.
For instance, in the enum NodeKind
the page read-only trx is used to read a name:
final String uri = pageReadTrx.getName(nameDel.getURIKey(), NodeKind.NAMESPACE);
In most occurrences the trx seems to be used to read the ResourceConfiguration
, which might simply be given as a parameter.
can i work on this issue
@pernelkanic of course :) the enum in question is PageKind
plus interface(s).
In the PageKind I've removed the PageReadOnlyTrx parameter and added a ResourceConfiguration parameter for passing the necessary data required for serialization and deserialization? is that correct?
Yes :-) maybe it would be even better to wrap the configuration in a context (simple data wrapper), but I guess it's ok :-)
@pernelkanic can you open a PR?
I have opened the PR, requesting review to know if there should be any changes.
Currently it fails to compile, because I think an export missing.
what should be done?
It seems like org.jcp.xml.dsig.internal.dom.Utils is import that is causing the issue , it is considered internal and used in java.xml.crypto
Does removing it fix the issue?
Why do you need java.xml.crypto for the changes? Can you remove the import and update your PR?
i have updated the pr