Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Make more functions static #3327

Closed
matthias-ronge opened this issue Mar 23, 2020 · 1 comment
Closed

Make more functions static #3327

matthias-ronge opened this issue Mar 23, 2020 · 1 comment

Comments

@matthias-ronge
Copy link
Collaborator

Production uses a service loader to initialize services once at runtime and to make them available later in the application. This makes sense for services that provide functionality from modules, since in this case the modules are loaded once at runtime. However, it makes no sense for static functions that are provided by services that do not use modules (and which do not have to be declared static).

Goal: In the services, declare all functions that work statically and do not use a module as static. Call these functions statically, without redirection via the service loader. If a service only provides static functions, remove the service from the service loader altogether.

@matthias-ronge
Copy link
Collaborator Author

matthias-ronge commented Sep 29, 2020

There are a number of classes in Production called Service. Some of them are related to database objects. In this case, the services perform actions on the database objects. The functionality is in the service, the data in the data-management module.

class                                 | service manager | module(s)
--------------------------------------+-----------------+---------------------------------------
AuthorityService                      | yes             | data-management
BatchService                          | yes             | data-management
ClientSearchDatabaseService           | no              |
ClientSearchService                   | no              |
ClientService                         | yes             | data-management
CommentService                        | yes             | data-management
DocketService                         | yes             | data-management
FilterService                         | yes             | data-management
FolderService                         | yes             | data-management
LdapGroupService                      | yes             | data-management
LdapServerService                     | yes             | data-management
ListColumnService                     | yes             | data-management
ProcessService                        | yes             | data-management, docket
ProjectSearchService                  | no              |
ProjectService                        | yes             | data-management
PropertyService                       | yes             | data-management
RoleService                           | yes             | data-management
RulesetService                        | yes             | data-management
SearchService                         | no              |
TaskService                           | yes             | data-management
TemplateService                       | yes             | data-management
TitleSearchService                    | no              |
UserService                           | yes             | data-management
WorkflowConditionService              | yes             | data-management
WorkflowService                       | yes             | data-management

Other services are related to the modules. The services call functions on the modules. The functionality is in the module, the services should do little except to access the module.

class                                 | service manager | module(s)
--------------------------------------+-----------------+---------------------------------------
CommandService                        | yes             | command
DataEditorService                     | yes             | dataeditor
FileService                           | yes             | file-management
ImageService                          | yes             | image-management
ImportService                         | yes             | query-url-import, xml-schema-converter
LongTermPreservationValidationService | yes             | longtimepreservationvalidation
MetadataValidationService             | yes             | validation
MetsService                           | yes             | dataformat
RulesetManagementService              | yes             | dataeditor

Some services are neither-nor. There is simply functionality in the services. Basically they are utility classes. Many of them use the service loader, some don't. In addition, there are a number of utility classes with other names.

class                                 | service manager | module(s)
--------------------------------------+-----------------+---------------------------------------
FileStructureValidationService        | yes             |
IndexingService                       | yes             |
MassImportService                     | yes             |
MigrationService                      | yes             |
SchemaService                         | yes             |
SecurityAccessService                 | yes             |
SessionService                        | yes             |
CalendarService                       | no              |
KitodoScriptService                   | no              |
SubfolderFactoryService               | no              |
WorkflowControllerService             | no              |

BatchHelper                           | no              |
BatchProcessHelper                    | no              |
BatchTaskHelper                       | no              |
DateUtils                             | no              |
FacesUtils                            | no              |
Helper                                | no              |
HibernateUtil                         | no              |
ImageHelper                           | no              |
JaxbXmlUtils                          | no              |
MetadataHelper                        | no              |
WikiFieldHelper                       | no              |
XMLUtils                              | no              |
XsltHelper                            | no              |

@solth solth removed the 3.x label Jul 7, 2022
@kitodo kitodo locked and limited conversation to collaborators Jan 10, 2023
@solth solth converted this issue into discussion #5502 Jan 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants