ฉันมีถั่ว:
<bean id="BasketLogic" class="efco.logic.EfcoBasketLogic" autowire="byType">
<property name="documentLogic" ref="DocumentLogic" />
<property name="stateAccess" ref="StateAccess" />
<property name="contextAccess" ref="ContextAccess" />
</bean>
<bean id="EfcoErpService" autowire="byType" class="efco.erp.service.EfcoErpServiceImpl">
<constructor-arg ref="ErpConnector"/>
</bean>
documentLogic, stateAccess และ contextAccess เป็นช่องใน BasketLogicImpl
และฉันไม่มี <context:component-scan />
EfcoBasketLogic.java:
public class EfcoBasketLogic extends BasketLogicImpl {
@Inject
private EfcoErpService erpService;
...
...
...
}
erpService เป็น null เว้นแต่ฉันจะระบุตัวตั้งค่าไว้ แต่ทำไม? ฉันคิดว่าไม่จำเป็นต้องใช้ตัวตั้งค่าเมื่อมีการเดินสายอัตโนมัติ เป็นไปได้ไหมที่ BasketLogicImpl รับผิดชอบเรื่องนั้น