Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If your BLL classes are being created by Unity, then it is not going to be a problem, the container will just provide the dependencies required by the BLL classes when they are created. If they are not, then you are going to run into an issue, simply because generally speaking, the object that creates your BLL class should also be providing it's dependencies.</p> <p>I would like to caution you on the use of Property based injection, though. The general rule of thumb in the Dependency Injection world is that <em>required</em> dependencies should be injected via the constructor, while <em>optional</em> dependencies should be injected via properties. If your class requires another class in order to do it's work, there should not be any way to create an instance of the class without also having its required dependencies as well. </p> <p>You mentioned using Property injection because of the number of dependencies in your BLL classes. While I understand this, I think it is still vital to follow the required = constructor rule. If you end up with a constructor that has too many dependencies, then this is a code smell that is pointing to a problem somewhere in your design. It could be that the class is taking on too many responsibilities (this usually is the case if you find that some methods require one group of dependencies, while another group require a different set). It could also be that the work being done with the dependencies is too granular, and could be wrapped in another object that could coordinate the work of the dependent classes. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload