Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
138
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Chapter 16: XML DTD Code Generation and Reverse

Engineering

Overview

We know that Rose can be used to model the design of a software system. It can be used to model the database and the business surrounding the system. But there is one more piece in many software systems that we haven't addressed so far: the use of Extensible Markup Language (XML). To get a complete picture of the system, we need to be able to see all of the pieces, including XML.

In this chapter, we'll discuss one of the new add−ins available for Rose: the integration with XML DTD (document type definition). As XML gains popularity in the industry, this new tool gives a design team the ability to model a complete software solution, including the code in C++, Visual Basic, or Java and the XML DTD components.

In this chapter, we'll take a look at how Rose can be used to model DTD elements, how DTD can be generated from Rose, and how DTD can be reverse engineered into Rose. Sometimes, a DTD can be just as complex as a system design model. Keeping track of the elements in a DTD and ensuring that the correct syntax is used can be a challenge. Rose gives you a picture of the DTD structure, making it easier for you to design the DTD and validate the design. Rose also provides you with a syntax check, so you can be sure the syntax is correct before you generate code.

Although we use the term "code generation," it is important to note that XML is not source code as we would typically think of it. XML is not a programming language, but rather a standard that can be used to exchange data between applications. Like HTML, XML includes tags that provide the interpreter with information about the data contained within the document. Unlike HTML, however, XML can include custom−defined tags. You can create a new standard data format using these custom tags and exchange data with anyone else, as long as they know the format.

This is where a DTD file comes in. The DTD includes metadata, or data about the data. It outlines the structure used by the XML file. An XML parser then uses the DTD file in conjunction with the XML file itself to interpret the file.

Setting XML DTD code−generation properties

Generating DTD files from your Rose model

Mapping Rose elements to DTD constructs

Reverse engineering DTD files

541