3 ms·
If your objects require dependencies to do their jobs, it should be impossible to create objects without those dependencies. The objects' constructors should re
by chrisguitarguy 11y ago
If your objects require dependencies to do their jobs, it should be impossible to create objects without those dependencies. The objects' constructors should require them. Having setters is, arguably, fine (but probably unnecessary) as long as invalid objects can't be created.