is very useful when your objects are being managed by a container, and containers typically separate object instantiation from object initializations. Some example containers would be Android, the servlet spec, and probably many others. Technically,
lateinit
has nothing to do with Java and nothing to do with dependency injection.
r
Ruckus
03/04/2018, 4:44 AM
I agree completely from a technical standpoint, my comment was for practical use. From my experience, in practice, that translates to dependency injection with Java frameworks the vast majority of the time, such as
@FXML
in the question. Granted, that may be a limitation of my experience.
Ruckus
03/04/2018, 4:46 AM
(Also, @orangy and I were replying to different questions. I'm not sure why you mentioned both of us.)