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

Convert utilities to beans #7718

Closed
qqmyers opened this issue Mar 24, 2021 · 2 comments
Closed

Convert utilities to beans #7718

qqmyers opened this issue Mar 24, 2021 · 2 comments

Comments

@qqmyers
Copy link
Member

qqmyers commented Mar 24, 2021

#7657 cleaned up cases where methods from services were duplicated or their results were passes as parameters. The initial proposal there was to convert Utility classes (MailUtil, JsonPrinter, BrandingUtil) with their static methods to beans. However to limit scope, the PR was changed to use the Helper pattern used with the microprofile classes to have a helper class add a service reference to the existing util classes, allowing them to keep static methods and for users of those classes to not have to inject them.

After some further discussion, it sounds like continuing and turning those utilities into @stateless or @singleton beans would be a cleaner solution, so this issue is a placeholder for that work. There are other issues suggesting other changes and ways to potentially eliminate/refactor these utility classes (see #6810, #7656) so this issue may be obsoleted if those issues are addressed first.

Note: there is a branch where this work was started. It is probably out of date/conflicting with some changes in #7657 by now, but could either serve as an example or be a source to merge from. (That branch did not address changing classes such as the OREMap class that use a utility to a bean as well (so one can inject the utility, so it was not complete when abandoned.)

As #7657 was enough to unblock further work for SPO, this issue won't be addressed as part of their efforts.

@qqmyers
Copy link
Member Author

qqmyers commented Mar 26, 2021

DdiExportUtil -is another class that needs the same changes.

@qqmyers
Copy link
Member Author

qqmyers commented Aug 26, 2024

#10774 is probably a better approach, although that requires some fixes to allow testing

@qqmyers qqmyers closed this as completed Aug 26, 2024
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

1 participant