Make more functions static #5502
Replies: 2 comments 2 replies
-
There are a number of classes in Production called
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.
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.
|
Beta Was this translation helpful? Give feedback.
-
I converted the original issue into a discussion because this is a slightly controversial topic and I know that not everyone agrees on the general usage of the @henning-gerhardt please feel free to contribute to this discussion here! |
Beta Was this translation helpful? Give feedback.
-
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.Beta Was this translation helpful? Give feedback.
All reactions