You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project makes use of the constructor pattern and manually managed lifecycles to create and use objects. In order to make the code more dependency injection ready and to reduce the amount of work required to convert the services within the project to an application framework, the existing code base should be prepared for use in a dependency injection enabled container. In addition to this preparation work, the conversion of these objects into dependency injection ready, container managed objects will improve the modularity of the code base. Allowing the framework to manage the lifecycle of these objects also makes it possible to introduce interfaces, which will allow us to leverage the application framework to inject different implementations in different environments.
Describe the solution you’d like
To prepare the project to leverage dependency, all objects that are currently created manually and provided to other objects should be identified and annotated as a bean. This will be done using either the JSR-330 annotations annotations. This includes marking the class as a @Singleton so that the framework will identify it and manage it at runtime and by marking any required fields as injectable (e.g. @Inject). This solution will NOT change or remove constructors – that will occur when converting applications to use a framework.
In addition, any classes that should be managed by the dependency injection framework but will need to be refactored due to how they are created (e.g. via static builder methods or other static utility methods) should be documented. A follow-on ticket will be created to address these classes.
Tell us about the problem you're trying to solve
The project makes use of the constructor pattern and manually managed lifecycles to create and use objects. In order to make the code more dependency injection ready and to reduce the amount of work required to convert the services within the project to an application framework, the existing code base should be prepared for use in a dependency injection enabled container. In addition to this preparation work, the conversion of these objects into dependency injection ready, container managed objects will improve the modularity of the code base. Allowing the framework to manage the lifecycle of these objects also makes it possible to introduce interfaces, which will allow us to leverage the application framework to inject different implementations in different environments.
Describe the solution you’d like
To prepare the project to leverage dependency, all objects that are currently created manually and provided to other objects should be identified and annotated as a bean. This will be done using either the JSR-330 annotations annotations. This includes marking the class as a
@Singleton
so that the framework will identify it and manage it at runtime and by marking any required fields as injectable (e.g.@Inject
). This solution will NOT change or remove constructors – that will occur when converting applications to use a framework.In addition, any classes that should be managed by the dependency injection framework but will need to be refactored due to how they are created (e.g. via static builder methods or other static utility methods) should be documented. A follow-on ticket will be created to address these classes.
More Details
'javax.inject:javax.inject:1'
Acceptance Criteria
The text was updated successfully, but these errors were encountered: