KR20020061888A - Method for developing xml application program - Google Patents

Method for developing xml application program Download PDF

Info

Publication number
KR20020061888A
KR20020061888A KR1020010002968A KR20010002968A KR20020061888A KR 20020061888 A KR20020061888 A KR 20020061888A KR 1020010002968 A KR1020010002968 A KR 1020010002968A KR 20010002968 A KR20010002968 A KR 20010002968A KR 20020061888 A KR20020061888 A KR 20020061888A
Authority
KR
South Korea
Prior art keywords
xml
schema
application program
generating
interface
Prior art date
Application number
KR1020010002968A
Other languages
Korean (ko)
Inventor
박철만
박상원
김형주
Original Assignee
박철만
(주) 아이티캠프
박상원
김형주
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 박철만, (주) 아이티캠프, 박상원, 김형주 filed Critical 박철만
Priority to KR1020010002968A priority Critical patent/KR20020061888A/en
Publication of KR20020061888A publication Critical patent/KR20020061888A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Abstract

PURPOSE: A method for developing an XML(eXtensible Markup Document) document is provided to support a developer with two steps of designing a schema and developing an XML application program by applying the XML schema and automatically generating an XML storage medium schema and a DOM(Document Object Model) API(Application Program Interface) from the XML schema. CONSTITUTION: The method comprises the steps of generating the schema including the conditions of the XML application program, generating the XML schema suitable to an object type of the schema, generating an RDB(Relational DataBase) using the XML schema, generating an interface using the RDB schema, and developing the XML application program using the application interface. The schema generation comprises the steps of designing a diagram including the conditions of the application program, making a class object corresponding to the XSCS(XML Schema Class Set) by receiving an attribute and an element necessary for the diagram, and adding the class object to an object list of an UML(Unified Modeling Language) modeler.

Description

엑스엠엘 응용프로그램의 개발방법{METHOD FOR DEVELOPING XML APPLICATION PROGRAM}Development method of XMEL application program {METHOD FOR DEVELOPING XML APPLICATION PROGRAM}

본 발명은 엑스엠엘 응용프로그램의 개발방법에 관한 것으로, 보다 상세하게는 엑스엠엘 응용프로그램의 조건들을 포함하는 스키마를 생성하는 스키마 생성단계와, 상기 스키마의 객체 타입에 맞게 엑스엠엘 스키마를 생성하는 엑스엠엘 스키마 생성단계와, 상기 엑스엠엘 스키마를 이용하여 알디비(RDB) 스키마를 생성하는 알디비 스키마 생성단계와, 상기 알디비 스키마를 이용하여 인터페이스를 생성하는 인터페이스 생성단계와, 상기 응용프로그램 인터페이스를 이용하여 엑스엠엘 응용프로그램을 개발하는 개발단계로 진행되므로써, 설계단계에서 정의된 내용을 쉽고 자연스럽게 개발 단계로 전달할 수 있도록 하는 엑스엠엘 응용프로그램의 개발방법에 관한 것이다.The present invention relates to a method for developing an XML application program, and more particularly, a schema generation step of generating a schema including conditions of an XML application program, and an XML schema generated according to an object type of the schema. An LS schema generation step, an ALDI schema generation step of generating an RDB schema using the XML schema, an interface generation step of generating an interface using the ALDI schema, and an application program interface. The present invention relates to a method of developing an XLM application program that allows the user to easily and naturally transfer the contents defined in the design stage to the development stage by progressing to the development stage of the application.

최근 인터넷에서의 데이터 교환 및 문서 포맷의 표준으로 XML(eXtensible Markup Language)이 각광을 받고 있다. XML 문서는 의미 단위 별로 계층화되어 태그를 통해 구분이 되어 있는데, 이러한 의미 단위 및 계층 구조는 그 문서의 DTD(Document Type Definition)에서 정의된다. XML 응용프로그램은 이 DTD를 분석함으로써 XML 문서의 구조를 파악하고 쉽게 데이터를 추출할 수 있게 되었다.Recently, XML (eXtensible Markup Language) has been in the spotlight as a standard for data exchange and document format on the Internet. XML documents are layered by semantic units and separated by tags. These semantic units and hierarchies are defined in the document type definition (DTD) of the document. By analyzing this DTD, XML applications can determine the structure of the XML document and easily extract data.

다양한 응용프로그램들이 쉽게 개발될 수 있을 것이라는 점 때문에 XML은 큰 기대를 얻었지만, 현재 XML은 그 기대에 부응하고 있지는 못하다. 그 이유는 여러 가지가 있겠으나, DTD가 표현하고 있는 정보가 응용프로그램이 이용하기에는 많은 부족함이 있다는 것을 한가지 이유로 들 수 있다. DTD를 통해서는 문서의 구조만을 정의할 수 있는데, 이 정보만으로는 응용프로그램이 문서를 효율적으로 분석, 활용하는데 충분치 않다는 것이다. 예를 들면, 회사의 회계문서들은 수많은 수치/통계 데이터로 이루어져 있음에도 DTD에서는 데이터간의 구조만을 제시할 뿐, 데이터들에 대한 타입에 관한 정보(Data type; 데이터타입)는 제공할 수 없다. 따라서, 방대한 양의 수치 데이터를 단지 문자열로서만 표현할 수밖에 없게 된다. 또한, 직원의 급여는 월 40만원 이하일 수 없다는 것과 같은 특정 수치 데이터가 가져야 하는 특성(Data constraint; 데이터 제약조건)들도 정의할 수 없다. 실제로 DTD를 사용해서 개발되는 응용프로그램에서는 위와 같은 데이터타입과 데이터 제약조건에 관해서는 개발자가 개발 단계에서 임의로 정하거나, 아예 고려를 하지 못하게 된다. 이는 설계 단계에서 명시되어야 할 여러 정보들이 개발 단계에서 제공 된다는 의미이며, 시스템 설계자가 작성해야 할 정보를 응용프로그램 개발자에게 상당 부분 전가하고 있다는 의미이다.XML has received great expectations because of the ease with which various applications can be developed, but at present XML does not live up to its expectations. There are many reasons for this, but one reason is that the information presented by the DTD is lacking for the application to use. The DTD allows you to define only the structure of a document, which is not enough for an application to efficiently analyze and utilize the document. For example, even though a company's accounting documents are composed of a large number of numerical / statistical data, the DTD only shows the structure between the data and cannot provide information on the type of data. Therefore, a large amount of numerical data can only be represented as a string. In addition, it is not possible to define the data constraints that certain numerical data must have, such as an employee's salary cannot be less than 400,000 won per month. In fact, in application programs developed using DTD, the above data types and data constraints are not arbitrarily decided by the developer at the development stage or not considered at all. This means that a lot of information that needs to be specified in the design phase is provided in the development stage, and that the information that the system designer needs to write is transferred to the application developer.

이미 업계의 대표적인 위치에 있는 여러 업체들은 DTD의 이러한 한계성을 깨닫고 나름대로의 XML 스키마 정의 언어(XML schema definition language)를 만들어 사용하게 되었으며, 이를 표준화하기 위한 XML Schema 정의 언어(XML Schema Definition Language; 이하 XML Schema) 안이 W3C(World Wide Web Consortium)에서 제안되었다.Many companies already in the industry have realized the limitations of the DTD and have created and used their own XML schema definition language, and XML Schema Definition Language (XML) Schema) was proposed by the World Wide Web Consortium (W3C).

XML Schema가 등장하면서 그 동안 DTD로는 할 수 없었던 세밀한 수준의 스키마 설계가 가능해졌다. 이로 인해 XML Schema 설계는 DTD보다 한층 더 복잡하게 되었으며, 따라서 스키마 모델링이 중요한 이슈가 된다. XML Schema의 설계는 개념적(Conceptual)이고 표준적인(Standard) 방법으로 이루어져야 한다. 또 XML Schema가 객체지향적인 개념을 많이 도입했음을 고려해 볼 때 객체지향 설계의 표준인 UML(Unified Modeling Language)은 XML Schema 설계에 가장 적합하다고 할 수 있겠다.With the advent of XML Schema, it is possible to design a level of schema that has not been possible with DTDs. This makes XML Schema design more complex than DTDs, so schema modeling becomes an important issue. The design of XML Schema should be done in a conceptual and standard way. Considering that XML Schema introduces many object-oriented concepts, UML (Unified Modeling Language), the standard for object-oriented design, is the most suitable for XML Schema design.

UML은 표준적인 객체 모델링 언어이며, XML Schema를 UML로 매핑하였다는 것은 표준적인 방법으로 XML 스키마에 대한 모델링을 가능하게 한다는 의미이다.UML is a standard object modeling language, and mapping XML Schema to UML means that you can model XML schemas in a standard way.

현재 UML과 XML 스키마 정의 언어와의 매핑 규약은 Rational Software사와 CommerceOne사가 합작으로 제시한 'SOX를 위한 UML 매핑 규약'이 있다. 이 규약은 UML의 확장 메카니즘(UML extension mechanism)을 사용, XML 스키마에 존재하는 컴포넌트를 새로운 UML 클래스로 생성하고 있다. 이 방법의 장점은 모델링의 방법에서 UML이라는 표준을 따른다는 점이다. 따라서, 기존의 UML을 지원하는 CASE 툴에서 별다른 수정 없이 XML 스키마를 모델링할 수 있다는 장점을 지닌다. 그러나, 단지 규약일 뿐이며 구현에 대한 내용은 CASE 툴 개발업체에 전가시키고 있다.Currently, the mapping protocol between UML and XML schema definition language is the "UML mapping protocol for SOX" jointly proposed by Rational Software Corporation and CommerceOne. This protocol uses the UML extension mechanism to create a new UML class for components in the XML schema. The advantage of this method is that it follows the standard of UML in the method of modeling. Therefore, it has the advantage that XML schema can be modeled without any modification in existing UMASE supporting CASE tool. However, it is just a convention and the implementation is passed on to the CASE tool developer.

XML Schema를 이용하여 설계된 스키마는 다양한 데이터타입과 데이터 제약조건들을 포함하게 된다. 그러나 설계 당시에 정의된 이러한 정보는 개발 단계에서 큰 이득을 주지는 못한다. 왜냐하면 개발자는 설계된 스키마를 보고 이들을 개발 단계에서 반영해야 하기 때문이다. 이 문제점은 설계 단계의 결과물로 XML 문서와 응용프로그램과의 중간 단계에서 데이터 변환 및 제약조건 체크 등을 수행하는 응용프로그램 개발 기반을 제공함으로써 해결할 수 있다. 이 응용프로그램 개발 기반은 개발자에게 표준적이고 사용하기 쉬운 인터페이스가 되어야 하는데, DOM(Document Object Model)이나 SAX(Simple API for XML)와 같은 XML을 위한 표준적인 인터페이스를 응용프로그램 개발 기반으로 사용함으로써 설계 단계에서 정의된 내용을 쉽고 자연스럽게 개발 단계로 전달시킬 수 있을 것이다. 이 과정을 통하여 개발자에게 XML 스키마를 설계하고 바로 응용프로그램 개발에 착수할 수 있는 "설계 후 즉시 개발(Design and develop)"이라는 XML 개발 방법을 제공해 줄 수 있다.Schemas designed using XML Schema will contain various datatypes and data constraints. However, this information, defined at the time of design, does not benefit greatly during development. This is because developers must look at the designed schemas and reflect them during development. This problem can be solved by providing an application development foundation that performs data transformation and constraint checking in the intermediate stage between the XML document and the application as a result of the design phase. This application development foundation should be a standard and easy-to-use interface for developers. The design phase is based on using a standard interface for XML, such as the Document Object Model (DOM) or the Simple API for XML (SAX). It will be easy and natural to pass the definition defined in the development stage. This process provides developers with an XML development method called "Design and develop" that allows them to design XML schemas and start developing applications immediately.

XML 응용프로그램의 개발 과정에 앞서, 응용프로그램이 다루게 되는 XML 문서의 일반적인 특징을 살펴보면 아래와 같은 세 가지로 분류할 수 있다.Before developing an XML application, the general characteristics of the XML document that the application deals with can be classified into three categories:

첫째, XML 문서는 복잡한 구조를 지니고 있다. 기존의 문서들은 단순한 나열 구조를 지니고 있는데 반하여, XML 문서는 중첩된 구조와 요소간의 참조들이 많이 나타나게 된다. 이러한 특징으로 인해, XML 문서의 구조를 모델링할 때에는 개념적이고 논리적인 수준의 디자인 방식을 도입하여야 한다.First, XML documents have a complex structure. Existing documents have a simple list structure, while XML documents have many nested structures and references between elements. Because of this feature, when designing the structure of an XML document, a conceptual and logical design approach should be introduced.

둘째, XML 문서는 영속성(Persistency)을 지니며, 그 규모가 방대하다. XML 문서는 그 자체로 데이터로써의 성격을 지니고 있다. 이는 그 문서가 일시적으로 사용되는 것이 아니라 영구적으로 보존되어야 한다는 것을 의미한다. 또, XML 문서는 중첩이 가능한 구조이기 때문에 작은 XML 문서들이 모여 하나의 큰 XML 문서로 형성되는 경향을 지니게 된다. 이로 인해, 하나의 XML 문서는 규모 면에서 하나의 데이터베이스에 해당할 정도로 방대해진다. 이 거대한 문서를 영구적으로 또 효율적으로 관리하기 위해서는 특별한 XML 저장매체에 대한 고려가 필요해 지게 된다.Second, XML documents have persistence and are massive. XML documents are in themselves as data. This means that the document is not to be used temporarily but must be preserved permanently. Also, because XML documents can be nested, small XML documents tend to gather into one large XML document. As a result, one XML document is so large that it corresponds to one database in size. Permanent and efficient management of this huge document requires consideration of a particular XML storage medium.

셋째, XML 문서는 그 문서를 이용하는 다양한 응용프로그램들이 존재한다. XML 문서의 방대성만큼이나 이 문서를 이용하기 위한 다양한 응용프로그램들이 존재하게 된다. 이들 응용프로그램은 XML 문서의 일부집합일 수도 있고, 전체 문서에 대한 검색일 수도 있으며, 데이터 마이닝과 같은 작업일 수도 있다. 그 만큼 다양한 응용이 존재하는데, 매번 XML 저장매체의 하부 구조를 직접 접근하여 응용프로그램을 개발하기에는 많은 문제점이 존재한다. 따라서, XML 저장매체에 독립적인 별도의 인터페이스가 필요하게 되며, DOM API는 표준적인 인터페이스로써 가장 적합하다고 볼 수 있다.Third, XML documents have various applications that use them. As much as the versatility of XML documents, there are many different applications for using them. These applications can be a subset of an XML document, a search over the entire document, or a task such as data mining. There are various applications, and there are many problems in developing an application program by directly accessing the infrastructure of the XML storage medium each time. Therefore, a separate interface that is independent of the XML storage medium is required, and the DOM API is most suitable as a standard interface.

본 발명은 상기와 같은 XML 문서의 특성을 고려할 때, XML 응용프로그램을 개발하기 위해서는 도1에서 보는 바와 같이 4단계를 거쳐야 한다.Considering the characteristics of the XML document as described above, the present invention has to go through four steps as shown in FIG. 1 to develop an XML application.

첫 번째 단계로 먼저 XML 스키마를 디자인을 한다. XML 스키마를 디자인하는 방법에는 여러 가지가 있을 수 있다. 기존의 방법들은 일반적인 XML 에디터를 확장하여 트리구조로 XML 스키마를 설계하도록 하였으며, "SOX를 위한 UML 매핑 규약"에서는 기존의 UML 기반의 CASE 툴에서 XML 스키마 정의 언어 중 하나인 SOX 스키마를 디자인 할 수 있는 기반을 제공해 준다.The first step is to design your XML schema. There are many ways to design an XML schema. Existing methods extend the general XML editor to design XML schema in tree structure, and "UML mapping protocol for SOX" can design SOX schema, one of XML schema definition languages in existing UML-based CASE tool. Provide the foundation for

이렇게 디자인된 XML 스키마를 통해 두 번째 단계에서는 XML 저장매체의 스키마를 생성한다. 이는 XML 문서의 영속성(Persistency)을 유지하기 위함이며, XML 저장매체로는 XML 전용 저장매체, 기존의 데이터베이스시스템, 파일시스템 등이 될 수 있다.With this designed XML schema, the second step is to create the schema of the XML storage medium. This is to maintain the persistence of the XML document. The XML storage medium may be an XML-only storage medium, an existing database system, or a file system.

XML 저장매체 스키마가 생성되었다면, 세 번째 단계로 XML 저장매체에 저장된 데이터를 다시 XML 문서로 변환해주는 API를 작성한다. 이는 XML 저장매체에 저장된 방식이 XML 문서의 형태와 다를 수 있기 때문이며, 개발자는 이렇게 작성된 API를 통해 일관된 형태로 XML 문서를 취급할 수 있다. 이 단계에서 API는 XML을 접근하기 위한 표준적인 방법이어야 하며, DOM(Document Object Model)이나 SAX(Simple API for XML)가 그 대상이 될 수 있다.Once the XML storage media schema has been created, the third step is to write an API that converts the data stored on the XML storage media back into an XML document. This is because the way that XML storage media is stored can be different from the format of XML documents, and developers can handle XML documents in a consistent form through this written API. At this stage, the API should be a standard way to access XML, and may be the Document Object Model (DOM) or the Simple API for XML (SAX).

위의 단계가 모두 끝났다면, 마지막으로 개발자는 XML 응용프로그램의 개발에 착수할 수 있다.Once all of the above steps have been completed, the developer can finally begin developing the XML application.

현재까지의 XML 응용프로그램의 개발 단계를 살펴보면, 개발자는 DTD 모델링 툴을 이용하여 XML 스키마를 디자인하고, 기존의 관계형 데이터베이스나 객체지향 데이터베이스 스키마로 변환하고, 이를 응용프로그램이 이용할 수 있는 API를 모두 작성하여야 하였다. 이 네 단계를 살펴보면, 두 번째와 세 번째 단계는 실제적인 XML 응용프로그램의 개발이라기보다는, XML 개발 환경의 구축이라는 성격이 더 강함을 알 수 있다.Looking at the development stage of an XML application to date, developers can use the DTD modeling tool to design an XML schema, convert it to an existing relational or object-oriented database schema, and write all the APIs that the application can use. Should be. Looking at these four phases, it is clear that the second and third phases are stronger than building an actual XML application, rather than building an XML development environment.

도1은 본 발명에 따른 일실시예에 있어서, XML 응용프로그램의 개발단계도.1 is a diagram illustrating the development of an XML application program according to an embodiment of the present invention.

도2는 본 발명에 따른 일실시예에 있어서, XSD4j의 구조도.2 is a structural diagram of an XSD4j according to an embodiment of the present invention;

도3은 본 발명에 따른 일실시예에 있어서, XSD4j 모델러의 다이어그램.Figure 3 is a diagram of an XSD4j modeler in one embodiment in accordance with the present invention.

도4는 본 발명에 따른 일실시예에 있어서, pruduct 엘리먼트의 속성.4 is an attribute of a pruduct element in one embodiment according to the present invention.

도5는 본 발명에 따른 일실시예에 있어서, PurchaserOrder 스키마.5 is a PurchaserOrder schema according to an embodiment of the present invention.

도6은 본 발명에 따른 일실시예에 있어서, 자바 DOM API의 구조도.6 is a structural diagram of a Java DOM API in an embodiment according to the present invention;

도7은 본 발명에 따른 일실시예에 있어서, XSD4j가 생성하는 자바 DOM API의 클래스 구조도.7 is a class structure diagram of a Java DOM API generated by XSD4j in an embodiment according to the present invention.

도8은 본 발명에 따른 적용예에 있어서, 간단한 구매정보관리 프로그램.8 is a simple purchase information management program in the application example according to the present invention.

본 발명에 의한 엑스엠엘 응용프로그램의 개발방법은,The development method of the XM L application program according to the present invention,

엑스엠엘 응용프로그램의 조건들을 포함하는 스키마를 생성하는 스키마 생성단계와; 상기 스키마의 객체 타입에 맞게 엑스엠엘 스키마를 생성하는 엑스엠엘 스키마 생성단계와; 상기 엑스엠엘 스키마를 이용하여 알디비(RDB) 스키마를 생성하는 알디비 스키마 생성단계와; 상기 알디비 스키마를 이용하여 인터페이스를 생성하는 인터페이스 생성단계와; 상기 응용프로그램 인터페이스를 이용하여 엑스엠엘 응용프로그램을 개발하는 개발단계;를 갖는 것을 특징으로 한다.A schema generation step of generating a schema including conditions of the XML application program; An XML schema generating step of generating an XML schema according to the object type of the schema; Generating an RDI schema using the XML schema; An interface generation step of generating an interface using the ALDI schema; And a development step of developing an XML application program using the application program interface.

상기 스키마 생성단계는, 응용프로그램의 조건들을 포함하는 다이어그램을 설계하는 다이어그램 설계과정과; 상기 다이어그램에서 필요한 속성과 원소를 입력받아 엑스에스씨에스(XSCS)에서 해당하는 클래스의 객체를 만든후, 유엠엘(UML) 모델러의 객체리스트에 추가하는 객체리스트 추가과정;을 포함하는 것을 특징으로 하기도 하며,The schema generation step may include a diagram design process of designing a diagram including conditions of an application program; And an object list adding process of inputting necessary attributes and elements in the diagram to create an object of a corresponding class in XSCS and adding the object list to an object list of a UML modeler. ,

상기 엑스엠엘 스키마 생성단계는, 상기 유엠엘과 엑스엠엘 스키머를 대응시키는 매핑과정을 추가로 갖는 것을 특징으로 하기도 하며,The XLM schema generating step may further include a mapping process for mapping the UML and the XML skimmer.

알디비 스키마 생성단계는, 상기 엑스엠엘 스키마와 상기 알디비 스키마의 매핑규칙은 기본 공유 테크닉 또는 공유 인라인 테크닉 또는 하이브리드 인라인 테크닉을 이용하는 것을 특징으로 하기도 하며,In the ALDIB schema generation step, the mapping rule between the XML schema and the ALDIB schema may be characterized by using a basic shared technique, a shared inline technique, or a hybrid inline technique.

상기 인터페이스 생성단계에서 상기 인터페이스는 돔 에이피아이(DOM API) 및/또는 삭스 에이피아이(SAX API)를 기반으로 사용하는 것을 특징으로 하기도 하며,In the interface generation step, the interface may be used based on Dom API and / or SAX API.

상기 인터페이스에서 사용하는 언어는 자바인 것을 특징으로 하기도 한다.The language used in the interface may be Java.

이하 실시예를 통하여 본 발명을 상세하게 설명한다. 그러나, 이들 실시예는 예시적인 목적일 뿐 본 발명이 이에 한정되는 것은 아니다.The present invention will be described in detail through the following examples. However, these examples are for illustrative purposes only and the present invention is not limited thereto.

[실시예]EXAMPLE

본 발명은 OOAD UML Modeler를 이용하여 XML Schema를 도입한 UML기반의 XML CASE 툴인 XSD4j(XML Schema Designer for Java)를 구현하였다. XSD4j에서는 DTD 기반의 XML 응용프로그램 개발에서의 문제점을 XML Schema를 도입함으로써 해결하고, 개발 단계에서 개발자가 XML 스키마를 설계하고 바로 XML 응용프로그램 개발에 착수할 수 있는 두 단계의 프로그램 개발 방법론을 제안하고 구현하였다. XSD4j는 모델링 과정에서 UML을 도입하여 표준적이고 개념적인 수준에서 XML 스키마를 디자인할 수 있도록 지원한다. 또한, XML 저장 매체의 스키마를 생성해 내고, 이 저장 매체와 DOM을 매핑하는 API를 자동 생성해 줌으로써, 개발자로 하여금, XML 스키마를 디자인하고 바로 응용프로그램 개발에 착수 할 수 있는 환경을 제공해 준다.The present invention implements XSD4j (XML Schema Designer for Java), a UML-based XML CASE tool that introduces XML Schema using OOAD UML Modeler. XSD4j solves the problem of DTD-based XML application development by introducing XML Schema, and proposes a two-stage program development methodology that allows developers to design XML schemas and start developing XML applications immediately. Implemented. XSD4j introduces UML during the modeling process to support the design of XML schemas at a standard and conceptual level. It also creates an XML storage media schema and automatically generates an API that maps the storage media and the DOM, providing developers with an environment to design XML schemas and start developing applications right away.

XSD4j가 하는 일을 크게 보면, XML 스키마를 모델링하는 것과, 모델링된 스키마를 이용하여 XML 응용프로그램을 개발할 수 있는 환경을 구축해 주는 일로 나누어 볼 수 있다. 따라서, 도2와 같이 전체 구조를 크게 두 부분으로 나누어 볼 수 있는데, 그 하나는 스키마 모델링과 관련된 일을 하는 XSD4j 모델러(XSD4j Modeler)이고, 나머지 하나가 XML Schema와 관련된 여러 문서(XML 스키마, XML 저장매체 스키마, DOM API 코드)들을 생성해 내는 XSD4j 문서 생성기(XSD4j Document Generator)이다.If you look at what XSD4j does, it can be divided into modeling an XML schema and building an environment in which an XML application can be developed using the modeled schema. Therefore, as shown in FIG. 2, the overall structure can be divided into two parts, one of which is XSD4j Modeler, which is related to schema modeling, and the other is a document related to XML Schema (XML schema, XML XSD4j Document Generator that generates storage schemas and DOM API code.

XSD4j 모델러는 UML에 기반한 XML 스키마 모델링을 지원한다. 개발자가 설계한 XML 스키마는 XSD4j XSCS(XSD4j XML Schema Class Set)에 있는 XML Schema 클래스의 리스트로 표현이 되며, 데이터 입력을 위한 인터페이스는 XSD4j UI(XSD4j User Interface)를 이용한다.The XSD4j modeler supports XML schema modeling based on UML. The developer-designed XML schema is expressed as a list of XML Schema classes in XSD4j XSCS (XSD4j XML Schema Class Set), and the interface for data input uses XSD4j UI (XSD4j User Interface).

XSD4j XSCS는 XML Schema에 정의된 여러 컴포넌트들을 UML의 스테레오타입으로 변환한 클래스들의 집합을 말하며, XSD4j UI는 XSCS의 여러 클래스들에 필요한 데이터를 사용자로부터 입력받기 위한 인터페이스를 제공하게 된다. XSD4j UI는 XSCS의 각 클래스들의 속성(Attribute)이나 원소(Element)들을 입력받는다.XSD4j XSCS is a set of classes that convert various components defined in XML Schema to stereotype of UML. XSD4j UI provides an interface for receiving data required for various classes of XSCS from user. XSD4j UI receives attributes or elements of each class of XSCS.

XSD4j UI가 사용하는 XSCS의 각 클래스에 대한 정보는 XSD4j 메타 정보 관리자(XSD4j Meta Information Manager)로부터 얻게 된다. XSD4j 메타 정보 관리자는XML Schema를 정의한 문서를 분석하여, XSD4j 모델러가 필요로 하는 여러 정보들을 제공한다.Information about each class of XSCS used by the XSD4j UI is obtained from the XSD4j Meta Information Manager. The XSD4j Meta Information Manager analyzes a document that defines an XML Schema and provides various information needed by the XSD4j modeler.

XSD4j 문서생성기는 XSD4j 모델러에서 모델링된 결과에서부터 XML 스키마 문서, XML 저장매체 스키마, DOM API를 생성해 내는 역할을 수행한다.The XSD4j document generator is responsible for generating XML schema documents, XML storage schemas, and DOM APIs from the results modeled by the XSD4j modeler.

XSD4j는 XML 스키마를 모델링한 후, 문서를 생성하는 두 단계로 이루어져있다. 사용자가 XML 스키마 다이어그램을 그리면, XSD4j UI는 다이어그램의 종류에 따라, 필요한 속성과 원소를 입력받는다. 입력받은 데이터를 이용하여 XSD4j XSCS에서 해당하는 클래스의 객체를 만든 후, UML Modeler의 객체리스트에 추가한다. XSCS의 클래스는 UML Modeler의 클래스를 스테레오타입으로 상속을 받은 것이므로, UML Modeler에서는 XSCS가 일반 UML 클래스로 처리가 된다.XSD4j consists of two steps of modeling an XML schema and then generating a document. When the user draws an XML schema diagram, the XSD4j UI receives the necessary attributes and elements according to the diagram type. Create an object of the corresponding class in XSD4j XSCS using the input data and add it to the object list of UML Modeler. Since XSCS class inherits UML Modeler's class as a stereotype, in UML Modeler, XSCS is treated as a general UML class.

이렇게 XML 스키마의 모델링이 끝나면, XSD4j 문서생성기는 XML 스키마 문서를 생성하게 된다. 문서생성기는 UML Modeler의 객체리스트를 순회하며, 객체의 타입에 맞게 XML 스키마 문서를 생성한다. XML 스키마와 XSCS의 클래스는 거의 일대일 대응이 되므로 간단히 XML 스키마가 생성될 수 있다.After modeling the XML schema, the XSD4j document generator generates the XML schema document. The document generator traverses the object list of UML Modeler and generates an XML schema document according to the object type. Since XML schemas and XSCS classes are almost one-to-one correspondences, XML schemas can be created simply.

XML 스키마를 생성한 후에는 XML 저장매체 스키마 생성과 DOM API 코드를 생성하게 된다. XSD4j는 XML 저장매체로 관계형 데이터베이스를 사용한다. XML 스키마와 관계형 데이터베이스 스키마는 일대일 대응이 되지 않으므로, 적당하게 변환해야 하는 작업이 필요하다. XSCS의 각 클래스는 관계형 데이터베이스 스키마 생성 룰을 포함하고 있으며, 이 룰에 의해 생성된 관계형 데이터베이스 스키마는 자료구조의 형태로 그 클래스에 저장되며, DOM API 생성 모듈에서 이 자료구조를 사용하게 된다.After creating the XML schema, you will be creating the XML storage schema and DOM API code. XSD4j uses a relational database as an XML storage medium. XML schemas and relational database schemas do not have a one-to-one correspondence, so work that needs to be done appropriately is necessary. Each class of XSCS includes a relational database schema generation rule. The relational database schema generated by this rule is stored in the class in the form of data structure, and this data structure is used in the DOM API generation module.

DOM API 코드 생성은 자바 언어로 되어 있으며, 앞에서 언급한 XSCS의 관계형 데이터베이스 스키마 자료구조를 참고하여 코드가 생성이 된다.DOM API code generation is in Java language, and the code is generated referring to the relational database schema data structure of XSCS mentioned above.

이 단계까지 마치면, 사용자는 모델링한 XML 스키마에 맞는 자바 DOM API를 얻게 되며, 이 API는 응용프로그램 작성의 기반이 된다.By the end of this step, you will have a Java DOM API that matches the XML schema you modeled, which is the basis for writing your application.

스키마 모델링에 UML을 사용하게 되면 앞에서 언급했다시피 개념적인 모델링이 가능하고 또한 표준을 따르게 된다. 따라서, XSD4j 모델러는 UML에 기반하여 XML 스키마를 설계할 수 있게 하였다. 그러나, UML과 XML 스키마와는 일대일 대응이 되지 않으며, 그렇기 때문에 XML Schema와 UML의 매핑 과정이 필요하게 된다.The use of UML for schema modeling enables conceptual modeling and conforms to standards, as mentioned earlier. Thus, the XSD4j modeler allows you to design XML schemas based on UML. However, there is no one-to-one correspondence between UML and XML Schema, and therefore, XML Schema and UML mapping process is required.

실제로 XML 스키마는 그 스키마를 사용하게 될 문서가 어떤 엘리먼트(Element)와 애트리뷰트(Attribute)를 가질 것인지, 그 값은 어떤 조건을 만족해야 하는지, 또 그것의 계층구조는 어떻게 될 것인지를 정의하는 것이다. 즉, XML 스키마의 가장 중요한 요소는 바로 엘리먼트와 애트리뷰트라고 할 수 있으며, 모델링 과정에서도 가장 중요한 것이 바로 이 두 요소이다. 나머지 요소들은 대부분 이 두 요소의 데이터타입이나 제약조건들을 정의하는 요소들이다. 따라서, UML의 다이어그램 상에 나타나는 정보는 도3과 같이 엘리먼트와 애트리뷰트가 중심이 되며, 나머지 요소들은 각 요소들의 속성으로 표현되어 진다. 이 다이어그램 상에서 나타나지 않는 정보는 도4에서 보듯이 각 엘리먼트의 속성으로 나타낼 수 있다.In fact, an XML schema defines what elements and attributes a document will use, what conditions the values must meet, and what its hierarchy will be. In other words, the most important elements of an XML schema are elements and attributes, and these two elements are most important in the modeling process. Most of the remaining elements are those that define the datatypes or constraints of these two elements. Therefore, the information appearing on the diagram of the UML is centered on elements and attributes as shown in FIG. 3, and the remaining elements are represented by attributes of each element. Information not shown on this diagram can be represented by the attributes of each element as shown in FIG.

실제 예로써 어떤 쇼핑몰에서 사용할 수 있는 간단한 구매 정보 XML 문서를보도록 하자. 이 쇼핑몰은 각 주문이 발생한 날짜에 대해 구매 정보를 관리하며, 한번의 구매에 대해서 구매자는 한명이어야 하며, 물품의 배송지는 구매자가 부재중일 때를 대비하여 두 곳을 지정할 수 있고, 한번의 구매를 통해 살 수 있는 제품의 종류는 무제한으로 한다는 정책을 가지고 있다고 하자.As a practical example, let's look at a simple purchasing information XML document that you can use in a shopping mall. The mall manages the purchase information for the date each order is made, the purchaser must be one for each purchase, and the destination of the item can be designated two places in case the buyer is absent. Let's say you have a policy of unlimited product types.

이 정책을 반영해서 설계한 XML 스키마는 도5와 같다. 즉, 한번의 구매에 대해 그 속성이 될 수 있는 구매 날짜를 애트리뷰트로 하고, 구매자의 이름과 배송지 주소, 구매 물품 등은 엘리먼트로 처리한다. 제품의 정보를 나타내는 ProductType이나 주소지에 관한 정보를 나타내는 AddressType등은 다른 요소에서 재활용할 수 있으므로 별도의 타입으로 지정하였으며, 구매정보타입인 PurchaseOrderType은 주소지와 제품 정보를 위해 각각 AddressType과 ProductType을 엘리먼트로 참조하게 된다. 이렇게 설계한 스키마를 XML 스키마로 생성하면 표1(간단한 주문정보 관련 XML 스키마)과 같다.The XML schema designed to reflect this policy is shown in FIG. In other words, the purchase date, which can be an attribute of one purchase, is an attribute, and the purchaser's name, shipping address, and purchased items are treated as elements. ProductType representing product information and AddressType representing address information can be recycled in other elements, so they are designated as separate types. PurchaseOrderType, a purchase information type, refers to AddressType and ProductType as elements for address and product information, respectively. Done. If you create this schema as an XML schema, it is shown in Table 1 (XML schema related to simple ordering information).

<schema><element name="purchaseOrder" minOccurs="0" maxOccurs="unbounded" type="PurchaseOrderType"/><complexType name="PurchaseOrderType"><attribute name="orderDate" type="date"/><element name="name" type="string"/><element name="address" ref="AddressType" maxOccurs="2"/><element name="product" ref="ProductType" maxOccurs="unbounded"/></complexType><complexType name="AddressType"><attribute name="value" type="string"/></complexType><complexType name="ProductType"><attribute name="value" type="string"/></complexType></schema><schema> <element name = "purchaseOrder" minOccurs = "0" maxOccurs = "unbounded" type = "PurchaseOrderType" /> <complexType name = "PurchaseOrderType"> <attribute name = "orderDate" type = "date" /> < element name = "name" type = "string" /> <element name = "address" ref = "AddressType" maxOccurs = "2" /> <element name = "product" ref = "ProductType" maxOccurs = "unbounded" / > </ complexType> <complexType name = "AddressType"> <attribute name = "value" type = "string" /> </ complexType> <complexType name = "ProductType"> <attribute name = "value" type = "string "/> </ complexType> </ schema>

XML 저장매체로는 여러 가지가 있을 수 있다. 일반적인 데이터베이스시스템일 수도 있고, XML 전용 스토리지 시스템일 수도 있으며, 파일시스템에 텍스트파일로 저장이 될 수도 있다. 어떤 저장매체가 좋은가에 대해서는 많은 논란이 존재한다. 그러나 본 논문에서는 어떤 시스템이 좋은지에 대해서는 언급하지 않기로 한다. 왜냐하면, XML 저장매체는 선택의 문제일 뿐, XML 응용프로그램의 개발과는 큰 관련성이 없기 때문이다. 이는 XSD4j가 XML 저장매체와는 독립적이고, 표준적인 인터페이스인 DOM API를 생성하기 때문에 가능하다.There can be several XML storage media. It can be a general database system, an XML-only storage system, or a text file stored in the file system. There is much debate about which storage medium is good. However, in this paper, I will not discuss which system is good. This is because XML storage media is only a matter of choice and has little to do with the development of XML applications. This is possible because XSD4j creates a DOM API that is independent of the XML storage medium and is a standard interface.

XSD4j는 XML 저장매체로 관계형 데이터베이스시스템을 지원한다. ODBMS의 경우에는 XML 스키마에서 데이터베이스 스키마로의 매핑은 거의 일대일로 이루어 질 수 있으며, XML 전용 스토리지 시스템의 경우는 별다른 매핑과정이 필요하지 않다. 파일시스템을 이용한 경우에도 별도의 XML 파서(XML Parser)를 도입함으로써 마찬가지로 별다른 매핑과정이 필요하지 않게 된다.XSD4j supports relational database systems as an XML storage medium. In the case of ODBMS, the mapping from XML schema to database schema can be almost one-to-one, and in the case of XML-only storage system, no mapping process is necessary. Even if the file system is used, a separate XML parser is introduced so that no special mapping process is required.

XML 스키마와 관계형 데이터베이스 스키마의 매핑 규칙은 기본공유(Basic Shared) 테크닉, 공유 인라인(Shared Inlining) 테크닉, 하이브리드 인라인(Hybrid Inlining) 테크닉과 유사한 방법을 이용한다. 이 테크닉은 원래 DTD로 정의된 XML 스키마를 관계형 데이터베이스 스키마로 변환하는 방식이다.Mapping rules for XML schemas and relational database schemas use similar techniques to Basic Shared, Shared Inlining, and Hybrid Inlining techniques. This technique converts an XML schema originally defined by a DTD into a relational database schema.

기본 공유(Basic Shared) 테크닉에 대해 설명한다.Basic sharing techniques are explained.

XML Schema에서 실질적으로 문서에 나타나는 데이터를 정의하는 요소는 엘리먼트를 정의하는Element태그와 애트리뷰트를 정의하는Attribute태그가 있다. 기본적으로 엘리먼트는 RDB의 테이블로, 애트리뷰트는 테이블의 필드로 변환이 가능한데, 애트리뷰트의 경우 한 애트리뷰트의 타입은 기본타입(Primitive type)이므로 변환에 큰 문제는 없다. 따라서 엘리먼트에 대해서 RDB 스키마로 변환하는 과정을 간단히 살펴보도록 하자. 기본 공유 테크닉에서는 엘리먼트가 가질 수 있는 모든 타입에 대해서 새로운 테이블(타입 테이블)을 생성한다. 이 테이블에는 그 엘리먼트의 애트리뷰트 값만을 필드로 가지게 되며, 엘리먼트간의 구조는 별도의 엘리먼트 테이블을 두어 해결한다.In XML Schema, the elements that actually define the data that appears in the document are the Element tag that defines the element and the Attribute tag that defines the attributes . Basically, an element can be converted into a table in an RDB and an attribute can be converted into a field in a table. In the case of an attribute, one attribute type is a primitive type, so there is no problem in the conversion. So let's briefly look at the process of converting an element to an RDB schema. The basic sharing technique creates a new table (type table) for every type an element can have. In this table, only the element's attribute value is a field, and the structure between elements is solved by having a separate element table.

알고리즘은 간단한데, 우선 공통으로 사용하는 엘리먼트 테이블을 생성한 후, 최상위 엘리먼트에서부터 깊이 우선 순회(Depth First Traversal)를 통해 엘리먼트의 타입들을 순회하며 타입 테이블을 생성해 낸다(표 2(기본 공유 테크닉의 RDB 스키마 생성 알고리즘)). 이 알고리즘에 따라 도5에서 설계한 XML 스키마를 RDB 스키마로 생성한 것이 표 3(기본 공유 테크닉을 이용해서 생성한 RDB 스키마)이다.The algorithm is simple: first create a commonly used element table, then traverse the element types through the depth first traversal from the top element and generate a type table (Table 2 (RDB of Basic Shared Techniques). Schema generation algorithm)). According to this algorithm, the XML schema designed in FIG. 5 is generated as an RDB schema. Table 3 (the RDB schema generated using the basic shared technique).

BeginRDBSchemaGeneration()GenerateElementTable();// Element를 위한 별도의 테이블을 생성ElementList = GetRootElements();for each element in ElementListdoMakeRDBSchema(element);MakeRDBSchema(element)elementType = element.getType();// Element의 타입에 해당하는 컴포넌트ElementList = elementType.getElements();// 타입의 엘리먼트에 대해서 작업을 수행for each element in ElementListdoMakeRDBSchema(element);elementType.GenerateRDBSchema(); // Attribute들을 필드로 가지는 테이블을 생성BeginRDBSchemaGeneration () GenerateElementTable (); // Create separate table for Element ElementList = GetRootElements (); for each element in ElementListdoMakeRDBSchema (element); MakeRDBSchema (element) elementType = element.getType (); // // For each element in ElementListdoMakeRDBSchema (element); elementType.GenerateRDBSchema (); // create a table with attributes as fields

CREATE TABLE XSE_ElementTable (_XSE_KEY_ int auto_increment primary key,parent int, child int, seq int default 0,TypeName varchar(255));CREATE TABLE PurchaseOrderType (_XSE_KEY_ int auto_increment PRIMARY KEY,orderDate date );CREATE TABLE AddressType (_XSE_KEY_ int auto_increment PRIMARY KEY,value varchar(255) );CREATE TABLE ProductType (_XSE_KEY_ int auto_increment PRIMARY KEY,value varchar(255) );CREATE TABLE string (_XSE_KEY_ int auto_increment primary key,data varchar(255));CREATE TABLE XSE_ElementTable (_XSE_KEY_ int auto_increment primary key, parent int, child int, seq int default 0, TypeName varchar (255)); CREATE TABLE PurchaseOrderType (_XSE_KEY_ int auto_increment PRIMARY KEY, orderDate date); CREATE TABLE AddressType (_MSEARY_KEYcre CREATE TABLE ProductType (_XSE_KEY_ int auto_increment PRIMARY KEY, value varchar (255)); CREATE TABLE string (_XSE_KEY_ int auto_increment primary key, data varchar (255));

엘리먼트의 부모/자식관계를 나타내는 테이블인 XSE_ElementTable에는 부모와 자식 노드의 키와, 자식의 키의 타입에 대한 정보, 엘리먼트의 순서에 대한 필드를 가지고 있다. 나머지 테이블은 엘리먼트의 타입에 대한 테이블이다.The XSE_ElementTable, a table that shows the parent / child relationships of elements, contains fields for the parent and child node keys, information about the key types of the child keys, and the order of the elements. The rest of the table is a table of element types.

기본공유 테크닉에 의해 생성된 결과는, XML의 구조를 다시 만들어 내기 위해서, 엘리먼트 테이블과 타입 테이블과의 조인(Join) 연산이 많이 발생하게 된다.이러한 조인 연산은 엘리먼트 테이블의 내용을 타입 테이블에 옮김으로써 어느 정도 줄일 수는 있으나, 효과적인 수준은 아니다. 실제로 조인 연산은 시스템의 성능에 가장 큰 영향을 미치는 요소이므로, RDB 스키마를 생성하는데 있어 조인 연산을 줄이는 것은 중요하다.The result generated by the basic sharing technique is that a lot of join operations between the element table and the type table occur to recreate the structure of the XML. These join operations move the contents of the element table into the type table. Can be reduced to some extent, but is not effective. In fact, join operations are the most important factor in system performance, so it is important to reduce join operations when creating RDB schemas.

공유 인라인 테크닉에 대해 설명한다.Explain shared inline techniques.

공유 인라인 테크닉이란, 테이블간의 조인(Join) 연산을 줄이기 위해 도입하는 방식이다. 즉, 불필요하게 생성되는 타입 테이블의 수를 줄임으로써 조인 연산의 수를 줄일 수 있다는 것이다. 실제로 기본 공유 테크닉에서 엘리먼트의 타입마다 따로 테이블을 생성하는 이유는 엘리먼트가 나타날 수 있는 횟수가 일정하지 않기 때문이다. 그러나 엘리먼트가 나타날 수 있는 횟수가 제한되어 있다면 미리 조인된 결과를 테이블로 생성해 두는 것이 가능해 진다. 즉 유한개의 엘리먼트에 대해 기존의 방식은 각각의 엘리먼트가 하나의 행(Row)으로써 존재하였으나, 공유 인라인 테크닉은 유한개의 엘리먼트를 하나의 행에 여러 개의 필드로 나열함으로써, 마치 하나의 행처럼 표현되게 하는 것이다. 따라서 조인의 결과도 하나의 행으로 표현되므로, 미리 조인된 테이블로 나타낼 수 있는 것이다.Shared inline techniques are introduced to reduce join operations between tables. In other words, the number of join operations can be reduced by reducing the number of unnecessary type tables. In fact, the basic sharing technique creates a table for each type of element because the number of times an element can appear is not constant. However, if the number of times an element can appear is limited, it is possible to create pre-joined results in a table. In other words, for the finite element, the existing method is that each element exists as one row, but the shared inline technique uses the finite element as one field by arranging multiple fields in one row, so that it is represented as a single row. It is. Therefore, the result of the join is also expressed as a single row, so it can be represented as a table that is joined in advance.

알고리즘은 기본 공유 테크닉의 알고리즘과 큰 차이가 없다. 단지, 엘리먼트들의 타입 테이블을 생성하는 단계에서 엘리먼트가 가지는maxOccurs값을 비교하는 단계에서, 그 값이unbounded일 때에만 엘리먼트의 타입 테이블을 생성하고, 아니라면 엘리먼트의 타입 테이블이 가져야 할 필드를maxOccurs개만큼 중복하여 현재의 타입 테이블에 추가한다.The algorithm is not much different from the algorithm of the basic sharing technique. In the step of comparing the maxOccurs value of an element in the step of creating the type table of elements, the element type table is created only when the value is unbounded , otherwise maxOccurs the number of fields the element type table should have. Duplicately add to the current type table.

이 방식을 이용하여 도5의 간단한 구매정보 XML 스키마를 RDB 스키마로 생성한 예를 표4(인라인 공유 테크닉을 이용해서 생성한 RDB 스키마)에서 볼 수 있다. 이 예를 보면, 별도의 조인 연산 없이도 address나 name 엘리먼트의 값을 얻어 올 수 있음을 볼 수 있다.An example of generating the simple purchase information XML schema of FIG. 5 as an RDB schema using this method can be seen in Table 4 (RDB schema created using an inline sharing technique). In this example, you can see that you can get the value of an address or name element without a separate join operation.

CREATE TABLE PurchaseOrderType (_XSE_KEY_ int auto_increment PRIMARY KEY,parent int,seq int,orderDate date,name varchar(255),addressvalue1 varchar(255),addressvalue2 varchar(255) );CREATE TABLE ProductType (_XSE_KEY_ int auto_icrement PRIMARY KEY,parent int,seq int,value varchar(255) );CREATE TABLE PurchaseOrderType (_XSE_KEY_ int auto_increment PRIMARY KEY, parent int, seq int, orderDate date, name varchar (255), addressvalue1 varchar (255), addressvalue2 varchar (255)); CREATE TABLE ProductType (_XSE_KEY_ int auto_icrement PRIMARY KEY, parent int , seq int, value varchar (255));

XSD4j는 XML 저장매체에 저장된 XML 문서와 실제 XML 응용프로그램과의 인터페이스를 위하여 자바 DOM API를 제공해 준다. 자바 DOM API를 이용하면 개발자로부터 XML 저장매체나 그 외의 XML과는 크게 관련이 없는 여러 가지 복잡한 작업들을 숨기고, XML 응용프로그램 개발에만 전념할 수 있는 환경을 구축해 주는 표준적인 환경을 제공할 수 있다. DOM API를 통해 XML 응용프로그램 개발자는 XML 문서가 응용프로그램의 메모리 공간상에 로드되어 있다는 가정을 할 수 있으며, 따라서, XML 저장매체에 대한 최소한의 고려만으로 XML 문서의 영속성(Persistency)을 구현할 수 있다.XSD4j provides a Java DOM API for interfacing XML documents stored on XML storage media with actual XML applications. The Java DOM API can be used to provide a standard environment for developers to hide from a variety of complex tasks that are not very relevant to XML storage media or other XML, and to build an environment dedicated to developing XML applications. The DOM API allows the XML application developer to make assumptions that the XML document is loaded in the application's memory space, thus enabling the persistence of the XML document with minimal consideration of the XML storage medium. .

자바 DOM API의 구조를 살펴본다.Let's look at the structure of the Java DOM API.

XSD4j가 생성하는 자바 DOM API의 구조는 도6에서 보는바와 같이 개발자로부터 가능한 하부구조를 모두 숨기는 형태를 띄고 있다. 실제로 개발자는 DOM API 중에서도Document,Collection,User Defined XML Elements가 인터페이스 역할을 수행하게 되며, 에러에 대한 예외처리(Exception Handling)는XSEException에서 처리가 된다.The structure of the Java DOM API generated by XSD4j has a form of hiding all possible infrastructures from the developer as shown in FIG. In fact, among the DOM APIs, developers, Document , Collection , and User Defined XML Elements act as interfaces, and exception handling for errors is handled in XSEException .

실제로 자바 DOM API는 도7과 같은 클래스 구조도를 갖는다. 그림에서 회색으로 표시된 클래스는 생성되는 XML 스키마에 종속적인 클래스이며, 그 외의 클래스는 모든 XML 스키마에 공통적으로 적용되는 클래스이다.In fact, the Java DOM API has a class structure diagram as shown in FIG. The grayed out classes in the figure are classes that depend on the generated XML schema, and the other classes are classes that apply to all XML schemas.

DOM 객체와 XML 저장매체와의 연동 전략에 대해 살펴본다.Let's take a look at the integration strategy between DOM objects and XML storage media.

DOM 객체는 메모리 상에 존재하므로 객체의 생성/유지에 대한 부하가 작은 반면에, XML 저장매체는 영구적인 저장장치(Storage Device)에 대한 작업을 필요로 하므로 그것에 대한 작업의 부하는 상당히 큰 편이다. 따라서, DOM 객체에 대한 작업(생성/수정/소멸)은 실제적인 XML 저장매체와는 독립적으로 이루어지게 해야 하며, 필요한 시점에서 작업 결과를 XML 저장매체에 반영하는 전략의 도입이 필수적이다.The DOM objects are in memory, so the load on creating and maintaining them is small, while the XML storage media requires working with persistent storage devices, so the load on them is quite large. . Therefore, the operation (creation / modification / destruction) of the DOM object should be made independent of the actual XML storage medium, and it is essential to introduce a strategy for reflecting the work result on the XML storage medium when necessary.

XSD4j가 생성하는 자바 DOM API에서의 DOM 객체는 처음 생성될 때 XML 저장매체에서 데이터를 읽어오기 위한 기본적인 정보(키)만을 가지고 있는 불완전한 상태로 된다. 그 후 실제로 데이터가 필요로 하게 되는 시점에서 DOM 객체를 완성시키며, 객체에 대한 작업이 최종적으로 완료되는 시점에서 XML 저장매체에 그 결과를 반영시키는 전략을 취한다.The DOM objects in the Java DOM API that XSD4j creates are incomplete when they are first created, containing only the basic information (keys) to read data from the XML storage medium. After that, we complete the DOM object at the point where the data is actually needed, and take the strategy of reflecting the result on the XML storage medium when the work on the object is finally completed.

이를 위해 DOM 객체는 표5(DOM 객체의 상태 플래그)와 같이DataReady,Dirty,Deleted,Temporary의 4가지 상태 플래그를 가진다.For this purpose, the DOM object has four status flags, DataReady , Dirty , Deleted , and Temporary , as shown in Table 5 (status flags of DOM objects).

상태 플래그Status flags 상 태condition DataReadyDataReady DOM 객체가 완성 상태인지 아닌지를 나타냄Indicates whether the DOM object is complete or not DirtyDirty DOM 객체의 내용이 수정이 됨The contents of the DOM object are modified DeletedDeleted 현재 DOM 객체가 삭제됨The current DOM object is deleted TemporaryTemporary 현재 생성된 DOM 객체는 XML 저장매체에 존재하지 않는 임시 객체임The currently created DOM object is a temporary object that does not exist in the XML storage medium

DataReady는 DOM 객체를 처음 얻어왔을 때는 거짓이다. 즉, DOM 객체가 불완전한 상태에 있음을 의미한다. 그 후, 객체에 대한 접근이 이루어질 때,DataReady가 거짓이면, XML 저장매체로부터 데이터를 읽어오고,DataReady는 참이 된다. 예외적으로 DOM 객체가 생성될 때DataReady가 참이 되는 경우가 있는데, 이는 DOM 객체의 부모 객체의 데이터를 읽어올 때 현재 객체의 내용을 알 수 있는 경우에 해당한다. 예를 들어 이런 경우는 앞에서 언급한 공유 인라인 방식의 RDB 스키마 생성 테크닉을 사용할 경우 나타날 수 있다. DataReady is false the first time a DOM object is obtained. This means that the DOM object is in an incomplete state. Then, when access to the object is made, if DataReady is false, data is read from the XML storage medium and DataReady is true. An exception is when DataReady is true when a DOM object is created, which is when the contents of the current object are known when reading the data of the DOM object's parent object. This can happen, for example, using the shared inline RDB schema creation technique mentioned earlier.

Dirty는 초기값은 거짓이다. 그리고 DOM 객체의 내용이 수정될 때 참이 된다.Dirty인 DOM 객체는 모든 작업이 완료된 후 XML 저장매체에 수정된 내용이 반영된다. 또한, 사용자가 명시적으로 DOM 객체를 XML 저장매체에 저장할 수도 있다. Dirty has an initial value of false. And true when the contents of the DOM object are modified. Dirty DOM objects reflect the modifications made to the XML storage medium after all work is done. You can also explicitly store DOM objects in XML storage.

Deleted는 초기값은 거짓이다. 그리고, DOM 객체를 사용자가 삭제할 때 참이 된다. DOM 객체는 Collection을 통해 집단적으로 삭제될 수도 있고, 객체 자신이 직접 자신을 삭제할 수도 있다. 삭제된 객체는 XML 저장매체에서 바로 삭제되지는 않으며, 모든 작업이 완료된 후 삭제된 결과가 XML 저장매체에 반영된다. Deleted is false by default. And it is true when the user deletes the DOM object. DOM objects can be deleted collectively through Collections, or they can delete themselves. Deleted objects are not immediately deleted from the XML storage media. After all operations are completed, the deleted objects are reflected in the XML storage media.

Temporary상태는 새로운 엘리먼트를 추가할 때 사용된다. 즉, DOM 객체를하나 생성하게 되면, 이 객체는Temporary상태에 있게 된다. 이 객체를 DOM 객체 Collection에 추가하면,Temporary상태가 해제되며, 모든 작업이 완료된 후, 추가된 객체는 XML 저장매체에 추가된다. Temporary state is used to add a new element. In other words, when you create a DOM object, it is in a Temporary state. When this object is added to the DOM object Collection, the temporary state is released, and after all the work is done, the added object is added to the XML storage medium.

자바 DOM API에서 XML 데이터 제약조건(Data constraints)의 지원에 대해 살펴본다.Explore the support for XML data constraints in the Java DOM API.

XML 스키마로 정의된 문서는 앞 절에서 설명한 방식으로 XML 저장매체에 영구적으로 저장이 되며, 저장된 내용을 다시 XML의 구조로 읽어올 수 있다. 그러나 지금까지의 방법으로는 XML 문서의 구조만을 다룰 수 있을 뿐이다. 이 절에서는 XML Schema에서 XML 문서의 유효성(Validity)을 정의할 수 있는 XML 데이터 제약 조건을 어떻게 제공할 수 있는가에 대해서 살펴보도록 한다.Documents defined as XML schemas are stored permanently in XML storage media as described in the previous section, and the stored contents can be read back into the structure of XML. However, the methods so far can only deal with the structure of XML documents. This section describes how XML Schema can provide XML data constraints that define the validity of XML documents.

XML 스키마에서 데이터 제약 조건은 크게 두 가지로 나누어 볼 수 있다. 첫째는 타입에 대한 제약 조건이며, 둘째는 엘리먼트에 대한 제약 조건이다. 전자의 경우는simpleType에 그 타입이 가질 수 있는 값의 범위에 대한 제약조건이 붙는 것이며, 후자는complexType에서 엘리먼트가 나타날 수 있는 횟수 등을 제약하는 경우이다.Data constraints in XML schema can be divided into two categories. The first is constraints on types, and the second is constraints on elements. In the former case, the simpleType has constraints on the range of values that the type can have. The latter restricts the number of times an element can appear in a complexType .

타입에 대한 제약 조건은 크게 값의 크기에 대한 조건과, 문자열의 길이나 패턴에 대한 조건으로 나누어 볼 수 있다.Constraints on types can be broadly divided into conditions for the size of the value and conditions for the length or pattern of the string.

크기에 대한 조건은 일반적으로 숫자에 대해 적용이 되며, 부등호 연산자로 일대일 변환할 수 있다. 즉,minExclusive는 '>',minInclusive는 '>=',maxExclusive는 '<',maxInclusive는 '<='로 대응될 수 있다.The condition for size is generally applied to numbers and can be converted one-to-one with inequality operators. That is, minExclusive may correspond to '>', minInclusive to '>=', maxExclusive to '<', and maxInclusive to '<='.

문자열에 대한 조건은 길이와 패턴이 있다. 길이는 문자열 길이 함수(자바에서는String.length()함수)를 통해 확인 가능하다. 패턴은 정규표현(Regular expression) 형태로 나타나지며, 따라서 별도의 정규표현 엔진을 제공하여 구현할 수 있다.Conditions for strings are length and pattern. The length can be checked using the string length function (in Java, the String.length () function). Patterns appear in the form of regular expressions, so they can be implemented by providing a separate regular expression engine.

엘리먼트에 대한 제약 조건은 엘리먼트가 몇 번 나타날 수 있는가를 나타내는maxOccurs,minOccurs와 엘리먼트의 값의 특성에 대한fixed,nullable조건이 있다.Constraints for elements include maxOccurs , minOccurs , which indicate how many times an element can appear, and fixed and nullable conditions for the characteristics of the element's value.

엘리먼트가 나타날 수 있는 최대값과 최소값을 지정하는maxOccursminOccurs는 엘리먼트의 Collection을 생성할 때와 새로운 엘리먼트를 Collection에 추가할 때 체크한다. MaxOccurs and minOccurs, which specify the maximum and minimum values that an element can appear in, are checked when creating a Collection of elements and when adding new elements to the Collection.

엘리먼트가 고정된 값을 가져야 함을 나타내는fixed속성과, 엘리먼트가 null값을 가질 수 있음을 나타내는nullable속성은 엘리먼트를 읽어올 때와 엘리먼트에 값을 지정할 때 체크한다.The fixed attribute, which indicates that an element must have a fixed value, and the nullable attribute, which indicates that an element can have a null value, are checked when the element is read and when the element is assigned a value.

[적용예][Application Example]

앞에서 본 간단한 구매정보 관련 XML 스키마(도5)를 이용하여, 구매정보 목록을 출력하고 데이터를 추가하는 간단한 XML 응용프로그램(도8)을 제작하는 과정을 살펴보도록 하자. 도5에서 설계한 스키마를 통해 표3이나 표4와 같은 관계형 데이터베이스를 위한 RDB 스키마와, 도7과 같은 자바 DOM API를 생성 해 준다. 이를 통해 응용프로그램 기반이 조성되었으며, 개발자는 이렇게 조성된 환경에서 간단히 DOM API를 사용함으로써 응용프로그램을 개발 할 수 있다. 실제로 개발자가 작성한 코드는 표6(XML 데이터를 읽어오는 모듈)과 표7(XML 문서에 데이터를 추가하는 모듈)에 나타나 있다.Let's take a look at the process of creating a simple XML application (Fig. 8) that outputs a list of purchase information and adds data using the simple XML schema (Fig. 5) related to the purchase information. The schema designed in Figure 5 creates an RDB schema for relational databases, such as Table 3 and Table 4, and the Java DOM API, as shown in Figure 7. This created a foundation for the application, and developers can develop applications by simply using the DOM API in this environment. In fact, the code you write is shown in Table 6 (the module that reads the XML data) and Table 7 (the module that adds data to the XML document).

try// XSEDocument(DB Host, DB User, User Password, Database Name)m_Doc = new XSEDocument("localhost", "xse", "pwxsedemo", "xse");XSECollection elemCol = m_Doc.getRoots();int length = elemCol.getLength();for(int i = 0; i < length; ++i)XSEPurchaseOrderTypeElement elem =(XSEPurchaseOrderTypeElement)elemCol.getItem(i);out.println(displayPurchaseOrder(elem));m_Doc.preDestroy();catch(XSEException E)out.println("<P>XSE Error1 : " + E.ErrorMsg() + "</P>");try // XSEDocument (DB Host, DB User, User Password, Database Name) m_Doc = new XSEDocument ("localhost", "xse", "pwxsedemo", "xse"); XSECollection elemCol = m_Doc.getRoots (); int length = elemCol.getLength (); for (int i = 0; i <length; ++ i) XSEPurchaseOrderTypeElement elem = (XSEPurchaseOrderTypeElement) elemCol.getItem (i); out.println (displayPurchaseOrder (elem)); m_Doc.preDestroy () ; catch (XSEException E) out.println ("<P> XSE Error1:" + E.ErrorMsg () + "</ P>");

tryjava.sql.Date date = new java.sql.Date(today.getYear(), today.getMonth(), today.getDay());XSECollection col = m_Doc.getRoots();XSEPurchaseOrderTypeElement elem = newXSEPurchaseOrderTypeElement();elem.setorderDate(date);col.add(0, elem);col.UpdateAll();XSECollection products = elem.getproducts();XSEProductTypeElement prod = newXSEProductTypeElement();prod.setvalue(product);products.add(0, prod);products.UpdateAll();catch(XSEException E)out.println("XSE Error3 : " + E.ErrorMsg());tryjava.sql.Date date = new java.sql.Date (today.getYear (), today.getMonth (), today.getDay ()); XSECollection col = m_Doc.getRoots (); XSEPurchaseOrderTypeElement elem = newXSEPurchaseOrderTypeElement (); elem .setorderDate (date); col.add (0, elem); col.UpdateAll (); XSECollection products = elem.getproducts (); XSEProductTypeElement prod = newXSEProductTypeElement (); prod.setvalue (product); products.add (0, prod); products.UpdateAll (); catch (XSEException E) out.println ("XSE Error3:" + E.ErrorMsg ());

이상과 같이 본 발명에 의하면, 엑스엠엘 스키마를 도입하고, 엑스엠엘 스키마에서 엑스엠엘 저장매체 스키마와 DOM API를 자동적으로 생성해 줌으로써, 개발자에게 "스키마를 디자인하고 XML 응용프로그램을 개발"하는 두 단계의 개발 프로세스를 지원할 수 있는 효과가 있다.As described above, according to the present invention, two steps of "designing a schema and developing an XML application" to a developer by introducing an XML schema and automatically generating an XML storage medium schema and a DOM API from the XML schema. It is effective to support the development process of.

Claims (6)

엑스엠엘(XML) 응용프로그램의 개발방법에 있어서,In the development method of the XML application program, 엑스엠엘 응용프로그램의 조건들을 포함하는 스키마를 생성하는 스키마 생성단계와;A schema generation step of generating a schema including conditions of the XML application program; 상기 스키마의 객체 타입에 맞게 엑스엠엘 스키마를 생성하는 엑스엠엘 스키마 생성단계와;An XML schema generating step of generating an XML schema according to the object type of the schema; 상기 엑스엠엘 스키마를 이용하여 알디비(RDB) 스키마를 생성하는 알디비 스키마 생성단계와;Generating an RDI schema using the XML schema; 상기 알디비 스키마를 이용하여 인터페이스를 생성하는 인터페이스 생성단계와;An interface generation step of generating an interface using the ALDI schema; 상기 응용프로그램 인터페이스를 이용하여 엑스엠엘 응용프로그램을 개발하는 개발단계;를 갖는 것을 특징으로 하는 엑스엠엘 응용프로그램의 개발방법.And a development step of developing an XLM application program using the application program interface. 제1항에 있어서,The method of claim 1, 상기 스키마 생성단계는,The schema generation step, 응용프로그램의 조건들을 포함하는 다이어그램을 설계하는 다이어그램 설계과정과;A diagram design process of designing a diagram including conditions of an application program; 상기 다이어그램에서 필요한 속성과 원소를 입력받아 엑스에스씨에스(XSCS)에서 해당하는 클래스의 객체를 만든후, 유엠엘(UML) 모델러의 객체리스트에 추가하는 객체리스트 추가과정;을 포함하는 것을 특징으로 하는 엑스엠엘 응용프로그램의 개발방법.And an object list adding process of inputting necessary attributes and elements in the diagram to create an object of a corresponding class in XSCS, and adding the object list to an object list of a UML modeler. How to develop XML application program. 제2항에 있어서,The method of claim 2, 상기 엑스엠엘 스키마 생성단계는,The XML schema generation step, 상기 유엠엘과 엑스엠엘 스키머를 대응시키는 매핑과정을 추가로 갖는 것을 특징으로 하는 엑스엠엘 응용프로그램의 개발방법.And a mapping process for mapping the UML and the XML skimmer. 제1항 내지 제3항 중 어느 한 항에 있어서,The method according to any one of claims 1 to 3, 알디비 스키마 생성단계는,Aldibi schema generation step, 상기 엑스엠엘 스키마와 상기 알디비 스키마의 매핑규칙은 기본 공유 테크닉 또는 공유 인라인 테크닉 또는 하이브리드 인라인 테크닉을 이용하는 것을 특징으로 하는 엑스엠엘 응용프로그램의 개발방법.The mapping rule of the XML schema and the Aldibi schema is a method of developing an XML application, characterized in that using a basic shared technique, a shared inline technique or a hybrid inline technique. 제4항에 있어서,The method of claim 4, wherein 상기 인터페이스 생성단계에서 상기 인터페이스는 돔 에이피아이(DOM API) 및/또는 삭스 에이피아이(SAX API)를 기반으로 사용하는 것을 특징으로 하는 엑스엠엘 응용프로그램의 개발방법.In the interface generation step, the interface is a development method of the XML application, characterized in that using based on the Dom API (SOM API) and / or SAX API (SAX API). 제5항에 있어서,The method of claim 5, 상기 인터페이스에서 사용하는 언어는 자바인 것을 특징으로 하는 엑스엠엘 응용프로그램의 개발방법.The language used in the interface is a method of developing an XML application, characterized in that Java.
KR1020010002968A 2001-01-18 2001-01-18 Method for developing xml application program KR20020061888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020010002968A KR20020061888A (en) 2001-01-18 2001-01-18 Method for developing xml application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020010002968A KR20020061888A (en) 2001-01-18 2001-01-18 Method for developing xml application program

Publications (1)

Publication Number Publication Date
KR20020061888A true KR20020061888A (en) 2002-07-25

Family

ID=27692127

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020010002968A KR20020061888A (en) 2001-01-18 2001-01-18 Method for developing xml application program

Country Status (1)

Country Link
KR (1) KR20020061888A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040043290A (en) * 2002-11-18 2004-05-24 (주) 아이엘솔루션 BML(Bayplan Markup Language) Design based on XML Schema and the media written by BML
KR100564739B1 (en) * 2002-11-26 2006-03-27 한국전자통신연구원 The method for generating memory resident object-relational schema/query by using UML
KR100942322B1 (en) * 2003-02-28 2010-02-12 마이크로소프트 코포레이션 System and method for defining and using subclasses declaratively within markup
CN109885780A (en) * 2019-02-14 2019-06-14 珠海天燕科技有限公司 Data processing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040043290A (en) * 2002-11-18 2004-05-24 (주) 아이엘솔루션 BML(Bayplan Markup Language) Design based on XML Schema and the media written by BML
KR100564739B1 (en) * 2002-11-26 2006-03-27 한국전자통신연구원 The method for generating memory resident object-relational schema/query by using UML
KR100942322B1 (en) * 2003-02-28 2010-02-12 마이크로소프트 코포레이션 System and method for defining and using subclasses declaratively within markup
CN109885780A (en) * 2019-02-14 2019-06-14 珠海天燕科技有限公司 Data processing method and device

Similar Documents

Publication Publication Date Title
US6785685B2 (en) Approach for transforming XML document to and from data objects in an object oriented framework for content management applications
US7805474B2 (en) Method and apparatus for mapping between XML and relational representations
US7599947B1 (en) Method and system for converting hierarchical database schemas into relational database schemas
US7386567B2 (en) Techniques for changing XML content in a relational database
US7124144B2 (en) Method and apparatus for storing semi-structured data in a structured manner
US6853997B2 (en) System and method for sharing, mapping, transforming data between relational and hierarchical databases
US6643633B2 (en) Storing fragmented XML data into a relational database by decomposing XML documents with application specific mappings
Bourret et al. A generic load/extract utility for data transfer between XML documents and relational databases
KR101086567B1 (en) System and method for storing and retrieving xml data encapsulated as an object in a database store
US7383255B2 (en) Common query runtime system and application programming interface
US5632031A (en) Method and means for encoding storing and retrieving hierarchical data processing information for a computer system
US5664181A (en) Computer program product and program storage device for a data transmission dictionary for encoding, storing, and retrieving hierarchical data processing information for a computer system
US7707159B2 (en) Method and apparatus for storing semi-structured data in a structured manner
US20070219959A1 (en) Computer product, database integration reference method, and database integration reference apparatus
JP2005018776A (en) Query intermediate language method and system
US20100185701A1 (en) Method and system for enabling life cycle maintenance of hierarchical database schemas in modeling tool
Maluf et al. NASA Technology Transfer System
US7953742B2 (en) Three-phase single-pass efficient processing of Xquery update
KR20020061888A (en) Method for developing xml application program
Francois Generalized SGML repositories: Requirements and modelling
Pal et al. XML support in Microsoft SQL Server 2005
Tzvetkov et al. Dbxml-connecting xml with relational databases
KR20020066151A (en) Spatial information distributing system based on open gis and method thereof
Nicolle et al. Interoperability of B2B applications: Methods and tools
Chen Supporting Set-at-a-time extensions for XML through DOM

Legal Events

Date Code Title Description
A201 Request for examination
N231 Notification of change of applicant
E902 Notification of reason for refusal
E601 Decision to refuse application