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

Clean architecture: Replace the PageReadOnlyTrx for serialization/deserialization of pages/nodes #519

Open
JohannesLichtenberger opened this issue Aug 24, 2022 · 12 comments

Comments

@JohannesLichtenberger
Copy link
Member

JohannesLichtenberger commented Aug 24, 2022

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.

@JohannesLichtenberger JohannesLichtenberger changed the title Clean architecture: Make Clean architecture: Replace the PageReadOnlyTrx for serialization/deserialization of pages/nodes Aug 24, 2022
@pernelkanic
Copy link

can i work on this issue

@JohannesLichtenberger
Copy link
Member Author

@pernelkanic of course :) the enum in question is PageKind plus interface(s).

@pernelkanic
Copy link

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?

@JohannesLichtenberger
Copy link
Member Author

Yes :-) maybe it would be even better to wrap the configuration in a context (simple data wrapper), but I guess it's ok :-)

@JohannesLichtenberger
Copy link
Member Author

@pernelkanic can you open a PR?

@pernelkanic
Copy link

I have opened the PR, requesting review to know if there should be any changes.

@JohannesLichtenberger
Copy link
Member Author

Currently it fails to compile, because I think an export missing.

@pernelkanic
Copy link

what should be done?

@pernelkanic
Copy link

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

@pernelkanic
Copy link

Does removing it fix the issue?

@JohannesLichtenberger
Copy link
Member Author

Why do you need java.xml.crypto for the changes? Can you remove the import and update your PR?

@pernelkanic
Copy link

i have updated the pr

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

No branches or pull requests

2 participants