XML 스키마 기반 설정

XML 스키마에 기초하여 새로운 XML 설정 문법이 나오고 있으며 점점 더 쉽게 XML을 설정할 수 있도록 Spring Framework은 진화하고 있다. 또한 XML 스키마를 확장하여 사용할 수도 있다. XML 설정하여 Bean을 정의하는 방식 외에 Annotation 기법을 활용하여 XML 설정에 대한 부담을 덜 수 있다.
  • 기본으로 제공되는 XML 스키마
  • Spring Framework에서 기본으로 제공되는 XML 스키마의 종류는 다음과 같다.
    [util, jee, lang, jms, tx, aop, context, tool, beans] (각각의 사용법은 Spring 매뉴얼 사이트를 참고하도록 한다.)
  • XML 스키마 확장 가능
  • 어플리케이션 개발 시 어플리케이션 도메인을 좀더 잘 표현할 자체적인 도메인 속성의 설정 태그를 작성할 수 있다.
    스키마를 확장하여 실제 XML 파일에 적용하여 사용하는 방법은 Spring 매뉴얼 사이트를 참고하도록 한다.
  • XML 설정에 대한 부담으로 Annotation 활용 제안
  • XML 스키마 참조 방법
  • <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance“
       xmlns:util=“http://www.springframework.org/schema/util”
       xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xmlns:jms="http://www.springframework.org/schema/jms"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/util 
          http://www.springframework.org/schema/util/spring-util-2.5.xsd
          http://www.springframework.org/schema/jee 
          http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
          http://www.springframework.org/schema/lang 
          http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
          http://www.springframework.org/schema/jms 
          http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
          http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
          http://www.springframework.org/schema/context 
          http://www.springframework.org/schema/context/spring-context-2.5.xsd">
          <!-- <bean/> definitions here -->
    </beans>