Is it a bad practice to set dependencies to NULL in a IoC container and supply the dependencies at runtime?
问题 I have a SocketManager class that contains a Socket and other fields. All fields except the Socket can be injected during the composition of the object graph with a DI framework. My idea was to simply build the entire object graph upfront by leaving Socket empty and set it during runtime. This would allow me to complete the SocketManager instantiation at one point in the code and use that instance throughout my entire program (as it was already set as an dependency through the DI framework)?