<aside> 1️⃣ XML을 사용한 스프링 설정
</aside>
<aside> 2️⃣ 간단한 작성예시
</aside>
<beans xmlns="<http://www.springframework.org/schema/beans>"
xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>"
xsi:schemaLocation="<http://www.springframework.org/schema/beans>
<http://www.springframework.org/schema/beans/spring-beans-3.0.xsd>">
<bean id="helloWorld" class="com.example.HelloWorld">
<property name="message" value="Hello World!"/>
</bean>
</beans>
beans
태그는 루트 엘리먼트이다.bean
태그는 Spring에서 관리하는 객체인 빈(bean)을 정의하는 것이다.bean
태그 안의 **id
**는 빈의 식별자이며, **class
**는 빈의 타입을 나타내는 완전한 클래스 이름이다.property
태그는 빈의 속성을 설정하는 데 사용되며, **name
**은 속성의 이름이고 **value
**는 설정할 값이다.<aside> 3️⃣ 스프링의 XML을 통한 Bean의 의존성 주입처리방식
</aside>
constructor-arg
태그나 property
태그에 ref
속성을 사용하면 다른 빈을 참조할 수 있다.<bean id="helloService" class="com.example.HelloService">
<property name="helloWorld" ref="helloWorld" />
</bean>
<aside> 4️⃣ XML을 사용한 스프링 설정방식의 장점
</aside>