반응형
SMALL
//@Component
@Named
class BusinessService{
DataService dataservice;
//@Autowired
@Inject
public void setDataservice(DataService dataservice) {
System.out.println("Setter injection");
this.dataservice = dataservice;
}
public DataService getDataservice() {
return dataservice;
}
}
//@Component
@Named
class DataService{
}
@Named -> Component를 대체함
@Inject -> Autowired를 대체함
반응형
LIST
'Spring > Spring framework' 카테고리의 다른 글
Spring Stereotype Annotations (0) | 2023.08.26 |
---|---|
Java 어노테이션과 XML 설정 (0) | 2023.08.25 |
@Lazy, @Scope, @PostConstruct, @PreDestroy (0) | 2023.08.25 |
@Component, @Bean 비교 (0) | 2023.08.21 |
Spring 용어 정리 (0) | 2023.08.21 |