주석 구성과 어셈블리 스캔 간의 차이점

https://grokonez.com/spring-framework/difference-between-annotation-config-and-component-scan
주석 구성과 어셈블리 스캔 간의 차이점
주석 구성과 어셈블리 스캔은 Spring Core의 중요한 기본 개념입니다.
이 강좌는 그것들과 그것들 사이의 차이를 어떻게 사용하는지 이해하는 데 도움을 줍니다.
개술
비안에 프로그램 상하문에 등록된 모든 주석을 활성화합니다.이 bean들은 XML이나 패키지 스캔을 통해 정의할 수 있습니다.
annotation config가 하는 모든 것을 완성할 뿐만 아니라, 자바 클래스를 bean으로 등록하고 @component, @Service, @Repository를 사용합니다.
둘사용법
이제 애플리케이션에서 만들고자 하는 계층 구조에서 시작합니다.
-|콩 이름
-|Bean 주소
-|두객
콩 이름 주입
------|Bean 주소 주입
1. XML의 전체 bean
Bean의 자바 클래스는 다음과 같습니다.

public class Name{ //... }
public class Address{ //... }

public class Customer {
    private Name name;
    private Address address;

    public Customer() //...
    public void setName(Name name) //setter injection...
    public void setAddress(Address address) //setter injection...
}
자세한 내용은 다음을 참조하십시오.
https://grokonez.com/spring-framework/difference-between-annotation-config-and-component-scan
주석 구성과 어셈블리 스캔 간의 차이점

좋은 웹페이지 즐겨찾기