Guice Beginner - How to bind concrete classes?

后端 未结 3 626
庸人自扰
庸人自扰 2021-02-01 13:13

I have this class:

public class House {
    private final Door door;
    private final Window window;
    private final Roof roof;

    @Inject
    public House(         


        
3条回答
  •  暖寄归人
    2021-02-01 13:59

    Binding is needed to link Interface and Implementation class (to change to other implementation in test env for example). But since you have concrete classes, no need for binding to, just bind classes

提交回复
热议问题