Skip to content

Convert utilities to beans #7718

@qqmyers

Description

@qqmyers

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions