Analysis and design, which includes almost the entire process of database model design. Power Designer can make use of the traffic flow

Chart, object-oriented model, conceptual data model, the physical data model can be generated VB, JAVA, PB, C #, and other

Kind of client development tools, applications, data warehouses but also for making structural model, and the model can be hired to design team

Line control. Through a bookstore to discuss the use of information management systems Power Designer Database Design and Implementation

The whole process.

Computer application technology two thousand and six total sixty-sixth Qi

2

1 based on the needs of UML Object Design

UML is a standard graphical modeling language, analysis of a standard design of object-oriented representation, and

It provides a unified people with different areas of communication standards, making system design can be independent of the specific modeling language and development

process. UML structure and behavior simulation objects defined use case diagram, class, sequence diagram, an object diagram, a state diagram, Co

Plot, FIG event, assembly and Deployment nine kinds of pattern for object-oriented system modeling. In Power Desinger9.5

Version has been providing support for all nine kinds of graphs. Use UML object-oriented model can clearly reflect the application

Structure (including dynamic and static), so that we can better develop and maintain the entire system.

System requirements Description: Customer inquiries through the Internet to get books you want, if there is, then send by Email

Book a request, send information to the bookselling system after a request by the librarian. First, the system updates inventory, then

Email sent confirmation to the customer, final implementation "sell" operations, update the relevant data.

From the above requirements can be obtained (as shown in FIG. 1 and 2) and associated with the sequence diagram of FIG.

Example 1 FIG systems

FIG sequence system of Figure 2

Class 3 system of FIG.

2 POM conversion between CDM and

After the workflow familiar with the system, began to design class diagram associated with the system (Figure 4). Here the main design

Four classes, wherein class ShowBOOK user interface to completion, its main task is to make user can

Interact with the database interface, the interface returns the query results; DbBOOK principal to complete the process of background data; DbManager

Computer application technology two thousand and six total sixty-sixth Qi

3

Class used to load the database driven by ODBC connection to the database, execute the query and the error into when using JDBC

Line processing, it is called ShowBOOK class and DbBOOK class. BOOK or related information for recording the books include:

Author, publication date, price, sale date.

FIG 4 conceptual data model system

 

Physical data model of the system of Figure 5

Next, to give the corresponding CDM (shown in FIG. 5) transformed by the class of FIG. Of course, in the actual design process, we

May be first obtained CDM, then converted to the corresponding OOM, again OOM processes (such as adding to the constructor and

Member function, etc.) and generate the application framework. The conceptual data model real-world information into abstract entities and links from

Generating entity relationship diagram (ER FIG), which reflects the overall configuration of the information system, shall be mainly described information between different

Read relationship, which is independent of the specific DBMS, allowing designers to focus on the design of the database, regardless of the

Specific implementation issues related to the environment. OOM to CDM conversion, including conversion and entity class, class attributes and a solid

Computer application technology two thousand and six total sixty-sixth Qi

4

Attribute converter, converting between inheritance and association.

3 CDM conversion between the PDM

PDM is not necessarily generated from the CDM, it can generate a script from the database, directly from the database can be reversed

Engineered, it can also be done directly in Power Designer.

Role of the physical data model is a conceptual data model binding to specific DBMS together, complete a physical data structure

Structure formation. With a CDM-based PDM can generate a different DBMS. PDM contains characteristics of the DBMS, including

Comprising a primary key, foreign key, candidate key, view, index, triggers, stored procedures, etc. Each of the Power Designer

Species it supports RDBMS has a DEF file DEF file contains each used to generate specific RDBMS data

Parameter library script can be modified in Power Designer, or you can modify with a text editor (ASCII file itself is

Format), this method allows syntax data type conversion, and generate a script database of global changes occur,

Under normal circumstances should be used with caution.

The CDM during the conversion of PDM, mainly related to three types of conversion: CDM entities and properties into PDM

中的表及表列;CDM中的联系转换为PDM中的参照完整性;CDM中、继承及递归关系的转

换。

本系统使用的是ORACLE数据库系统,转换后的PDM如图6所示。

图6 OOM,CDM和PDM之间的关系

4 生成ORACLE 数据库

生成物理数据模型后,需要对其进行一定的调整才能生成数据到数据库。根据CDM中

的业务规则,我门要做的工作有:保证数据的完整性和一致性,生成视图和索引,编写相

关的触发器和存储过程等等。在生成数据库时,可以有两种方法:一是先生成数据库脚本,

然后在数据库管理系统中执行该脚本以生成数据;另外一种是通过ODBC连接直接在数据

ODBC

OOM

CDM PDM

System request

Application structure

Application source

(java, PB, VB, C#)

Data structures

Business rules

Data integrality

View and index

Trigger and procedure

SQL script DBMS

电脑应用技术 二零零六总第六十六期

5

库中生成数据并产生脚本。ODBC是Windows环境下连接到数据库管理系统的标准接口,

其本质是一个开放的、方便的、标准的应用程序接口。这个API提供了访问关系型和非关

系型DBMS的接口,同时也提供了逆向工程这些DBMS的能力。由于在之前的PDM中已经

选择了ORACLE的DBMS,所以若要生成ORACLE数据库,需要预先建立ORACLE的ODBC

连接。

一般而言,在实际工作中,多采用第一种方法,即先生成SQL脚本,然后人工检查,

确认无误后再生成数据库。

5 OOM、CDM、PDM 之间的关系

OOM, CDM和PDM这三种模型之间是可以相互转化的,它们之间的关系如图7所示。

我们可以根据需要从OOM开始设计,也可以从CDM或从PDM开始设计。

Power Designer根据三种模型对象之间的对应关系和一定的转换规则,实现三种模型

之间的转换。表1给出了它们之间的对应关系。

表1 OOM,CDM和PDM对象之间的转换关系

OOM objects CDM objects PDM objects

Class Entity Table

Class attribute Entity attribute Column

Identifier Primary identifier Primary/foreign key

Identifier Secondary identifier Alternative key

Association Relationship/association Reference/table

Generalization Inheritance Reference

Domain Domain Domain

Association class Association with attributes Table

Class operations N/A Procedure and trigger

Interface/dependency/realization N/A N/A

6 小 结

利用Power Designer进行项目开发,可以有效提高我们的开发速度,尤其是针对大中

型信息管理系统,Power Designer拥有的完整的所有模型类型的元数据知识库将为所有建

模者提供理想的团队开发环境。而其强大的报告生成功能,将使开发人员和用户更迅速地

了解项目的技术细节,可以在很大程度上降低维护费用。当然,Power Designer毕竟只是

一种工具,不可能代替开发人员完成所有的事情,只有当开发人员深刻理解UML,数据库

原理,SQL, JAVA等基础理论和技术时,才能够让Power Designer发挥其最大优势。

参考文献

[1] 刘润东.UML对象设计与编程[M]. 北京:北京希望电子出版社,2001.

[2] 白尚旺. PowerDesigner数据库建模技术[M]. 西安:西安电子科技大学出版社,2002.

[3] Sybase Corporation. Sybase PowerDesigner Tutorial[R]. 2001.

如果使用UML进行一个完整的系统分析和设计,他的步骤是:用例图->序列图->类图->TDD方法的敏捷开发。

那么,对于我们常用的PD,进行一个完整的系统分析和设计应遵循什么步骤呢?先用OOM(对应UML)实现用例图序列图类图->根据类图抽象出CDM(对应ER)->具体出PDM->生成数据库。

当然,最主要的不是流程怎样,而是根据具体的项目要灵活运用。

下面是我辛苦找来的一片文章,希望能给大家带来一点参考。