Design patterns·Wiring: injection, containers and lifetimes
the object is constructed first and wired afterwards, so there is a window where calling it throws a null reference.
Setter injection
Also calledproperty injection, setter-based injection
Supplying dependencies through settable properties after construction. It exists for genuinely optional collaborators and for breaking a construction cycle, and it is worth knowing for both reasons; used by default it produces objects with no valid state guarantee and error messages that point at the wrong moment. Frameworks that inject into private fields by reflection are the same trade with the setter hidden.