Gentle Breeze

Technical Service <3> Properties Service 본문

⑦ IFSS 방법론/IFSS 기초(개발자)

Technical Service <3> Properties Service

재령 2008. 10. 8. 10:52

* Properties Service
    - 외부 파일이나 환경 정보에 구성된 key, value 값을 가지고 있고
       App.는 특정 key 에 대한 value 값에 접근할 수 있도록 하는 서비스

* 예시
    - xml
      <bean name="propertiesService" class="systemier.services.properties.impl.PropertiesServiceImpl">
          <config:configuration> //xml 파일에 key 와 value 값을 setting
                <fileName>classpath:/services/properties/testcase-resource.properties</fileName>
                <properties>
                     <element key="AAAA" value="1234"/>
                     <element key="bbbb" value="4543242367"/>
                     <element key="cccc" value="5678"/>
                     <element key="PAGE_SIZE" value="10"/>
                     <element key="PAGE_UNIT" value="10"/>
                </properties>    
          </config:configuration>
      </bean>  

    - java class
      IPropertiesService propertiesService = (IPropertiesService) context.getBean("propertiesService");
      System.out.println(propertiesService.getString("PAGE_SIZE"));

    - IPropertiesService는 인터페이스,
      이 인터페이스를 구현한 클래스는 systemier.services.properties.impl.PropertiesServiceImpl

'⑦ IFSS 방법론 > IFSS 기초(개발자)' 카테고리의 다른 글

Technical Service <5> IdGeneration Service  (0) 2008.10.08
Technical Service <4> DataSource Service  (0) 2008.10.08
Technical Service <2> Logging Service  (0) 2008.10.08
Technical Service <1> 개요  (0) 2008.10.08
Beans  (0) 2008.10.07
Comments