Advanced Database Design and Application of 05 - XML database modeling

First, the purpose of the experiment

  1. In this study, the key point is that the training required to master the ability to write and database design documents, and can take advantage of XML database created've learned pattern, caused by the realization of the habit of learning.
  2. It also requires experimental important and difficult knowledge combing the experiments involved, namely: XML database schema design and XML architecture, requires that after the transition data is stored in the form of XML form, form their own on XML database schema design and related knowledge created.

 

 

 

Second, the experimental content

Import experimental background:

A company received an online shopping system project, you do appoint the task database designers, online shopping system overall database design. Webshop is a model of B2C e-Commerce, e-commerce system enables the user includes the foreground and background management of two parts.

Among them, the front desk shopping system includes member registration, member login, product display, product search, shopping cart, generating orders and membership information changes and more. Background management system includes user management, maintenance of library goods, process orders, maintain member information and other administrative functions.

System functional description and analysis based on real business, electronic mall database related design, complete test requirements are as follows:

  1. Needs analysis statement.

In the early database design, system functional requirements specification is first written. This link complete the preliminary documentation on the system functional requirements.

  1. XSM model design.

XML logic into the design phase, the need for design entity relationship model, the abstract reality of the system after use learned XSM XML content model. In this session, only to be required to complete four experimental content above.

 

 

 

 

Third, experimental platform

Software: POWER DESIGNER, WORD

   

 

 

Fourth, the experimental procedures

Since the temporary experiment, complete on the needs analysis statement here will no longer be repeated. In the early database design, system functional requirements specification writing. See a part of this experiment.

  1. XSM model design.

Below are listed throughout the experiment, the number of steps involved, and implementation on POWER DESIGNER some of the requirements in the present experiment:

① Open powerdesigner, click on the "File" menu, then select "new model";

② In the "New Model" screen, select "Information" in the "Type", select the "XML" in the "type item" and click "OK";

③ right side of the toolbar, click on the "elements" icon in the "XML model map", then click once on the main window, you create an element;

④ Double-click an element in the pop-up window, select "Properties" tab, you can increase the property, then the "Preview" tab, you can view the XML text elements defined;

⑤ on the right side of the toolbar, click on the "elements" icon in the "XML model map", then click once, which can increase a child element under the element on an element;

⑥ in the toolbar on the right, click on the "complex type" icon in the "XML model map", then click once on the main window, generates a complex type;

⑦ Double-click a complex type in the pop-up window, select "Properties" tab, you can increase the property, then the "Preview" tab, you can view the text XML complex type definitions.

 

 

 

 

6.3.5 Operating results

  1. Needs analysis statement. About this section, see section 1 of the experimental design, slightly.
  2. XSM model design

Shown in Figure 5-1, the overall XSM model of the present experiment. The present experiment on XSM model design, a method adopted is to define complex data types in the group, that is, with reference to the source of the object may be the entire set of elements, or a single complex type. However, different types of single, complex and is used when the method of the group, either into an instance of a target object can be instantiated as a complex type.

 

Figure 5-1 overall model XSM

 

        In the above this entire XSM model for surface design draft requirements, without detailed data types include peripheral elements. The following is the entire XSM model is split into seven modules, and these modules are instantiated seven xml form of documents.

The seven modules are: commodity type, employee users, product information, user membership, order details, order information, and payment type, specific detailed the following:

 

1) RD_COMMODITY_TYPES product type model, as follows:

 

<?xml version="1.0"?>

<RD_COMMODITY_TYPES>

 <ROW>

  <COMMODITY_TYPE_ID>0001</COMMODITY_TYPE_ID>

  <STATUS>推荐</STATUS>

  <COMMODITY_TYPE>01</COMMODITY_TYPE>

 </ROW>

 <ROW>

  <COMMODITY_TYPE_ID>0002</COMMODITY_TYPE_ID>

  <STATUS>热点</STATUS>

  <COMMODITY_TYPE>02</COMMODITY_TYPE>

 </ROW>

</RD_COMMODITY_TYPES>

 

 

2)      RD_EMPLOYEES员工用户模型,如下:

 

<?xml version="1.0"?>

<RD_EMPLOYEES>

 <ROW>

  <EMPLOYEE_ID>0001</EMPLOYEE_ID>

  <EMPLOYEE_PASSWORD>123456</EMPLOYEE_PASSWORD>

  <EMPLOYEE_NAME>张三</EMPLOYEE_NAME>

  <BIRTH>03-3月 -19</BIRTH>

  <ADDRESS>北京八达岭</ADDRESS>

  <MOBILE>1109635</MOBILE>

  <WECHAT>53425223</WECHAT>

  <REPUTATION>98</REPUTATION>

  <DEPARTMENT>销售部门</DEPARTMENT>

  <SEX>男</SEX>

  <COMPANY>北京岭科技有限公司</COMPANY>

 </ROW>

 <ROW>

  <EMPLOYEE_ID>0002</EMPLOYEE_ID>

  <EMPLOYEE_PASSWORD>123456</EMPLOYEE_PASSWORD>

  <EMPLOYEE_NAME>李四</EMPLOYEE_NAME>

  <BIRTH>03-3月 -19</BIRTH>

  <ADDRESS>杭州西湖边</ADDRESS>

  <MOBILE>1109635</MOBILE>

  <WECHAT>53425223</WECHAT>

  <REPUTATION>98</REPUTATION>

  <DEPARTMENT>作坊</DEPARTMENT>

  <SEX>男</SEX>

  <COMPANY>西湖臭豆腐西施作坊</COMPANY>

 </ROW>

</RD_EMPLOYEES>

 


  

3)      RD_GOODS商品信息模型,如下:

 

  

<?xml version="1.0"?>

<RD_GOODS>

 <ROW>

  <GOOD_ID>0001</GOOD_ID>

  <DISCOUNT>0.8</DISCOUNT>

  <GOODS>豆浆</GOODS>

  <UNIT_PRICE>23.5</UNIT_PRICE>

  <PURCHASE_DATE>2017-32-23</PURCHASE_DATE>

<GOOD_TYPE>0000220208257F4C4F5E8846809E167003A33DE7567903A3E017164E92B6AEB24EFC68ACB0</GOOD_TYPE>

 </ROW>

 <ROW>

  <GOOD_ID>0002</GOOD_ID>

  <DISCOUNT>0.8</DISCOUNT>

  <GOODS>无人机</GOODS>

  <UNIT_PRICE>23.5</UNIT_PRICE>

  <PURCHASE_DATE>2017-32-23</PURCHASE_DATE>

<GOOD_TYPE>0000220208257F4C4F5E8846809E167003A33DE7567903A3E017164E92B6AEB24EFC68ACB0</GOOD_TYPE>

 </ROW>

</RD_GOODS>

 

 

 

4)      RD_MEMBERS会员用户信息模型,如下:

 

  

<?xml version="1.0"?>

<RD_MEMBERS>

 <ROW>

  <MEMBER_ID>0001</MEMBER_ID>

  <MEMBER_PASSWORD>123456</MEMBER_PASSWORD>

  <MEMBER_NAME>昊哥</MEMBER_NAME>

  <BIRTH>18-11月-19</BIRTH>

  <ADDRESS>广西南宁</ADDRESS>

  <MOBILE>1008611</MOBILE>

  <WECHAT>10010</WECHAT>

  <REPUTATION>100</REPUTATION>

  <HOBBY>喜欢电子产品</HOBBY>

  <SEX>男</SEX>

  <JOBE>教师</JOBE>

 </ROW>

 <ROW>

  <MEMBER_ID>0002</MEMBER_ID>

  <MEMBER_PASSWORD>123456</MEMBER_PASSWORD>

  <MEMBER_NAME>小弟</MEMBER_NAME>

  <BIRTH>18-11月-19</BIRTH>

  <ADDRESS>广西藤县</ADDRESS>

  <MOBILE>10010</MOBILE>

  <WECHAT>1008611</WECHAT>

  <REPUTATION>100</REPUTATION>

  <HOBBY>喜欢麻婆豆腐</HOBBY>

  <SEX>男</SEX>

  <JOBE>学生</JOBE>

 </ROW>

</RD_MEMBERS>

 

 

5)      RD_ORDER_DETAILSS订单详情信息模型,如下:

 

<?xml version="1.0"?>

<RD_ORDER_DETAILSS>

 <ROW>

  <ORDER_DETAILS_ID>0001</ORDER_DETAILS_ID>

  <ORDER_DETAILS>OK</ORDER_DETAILS>

<GOOD_INFO>0000220208A9FA6DA5A45442C389A2FE43D4FEC10A4592F3AFBA0847778C2C3007B8E9CC54</GOOD_INFO>

<PAYMENT_TYPE_INFO>000022020805638F9B0CAE4903AB0741146B880F2A9C2E9B64584D420E92F38A5D0ABC39DA</PAYMENT_TYPE_INFO>

<EMPLOYEE_INFO>0000220208764E2860152D4F70B3A869DD82361E5379225ACE0AC44544B0230F4854E6C588</EMPLOYEE_INFO>

<MEMBER_INFO>0000220208CEDFD42D87E34731BA8D5CA01813BD16C3C3FD52C4354F53825B30F61E7C3015</MEMBER_INFO>

 </ROW>

 <ROW>

  <ORDER_DETAILS_ID>0002</ORDER_DETAILS_ID>

  <ORDER_DETAILS>OK</ORDER_DETAILS>

<GOOD_INFO>000022020838B293D236AE443AA95C6B45B00D22954592F3AFBA0847778C2C3007B8E9CC54</GOOD_INFO>

<PAYMENT_TYPE_INFO>000022020806D23EC66465455182841041FA8756779C2E9B64584D420E92F38A5D0ABC39DA</PAYMENT_TYPE_INFO>

<EMPLOYEE_INFO>00002202084786E2C886A0498E844CFF540F88CC9879225ACE0AC44544B0230F4854E6C588</EMPLOYEE_INFO>

<MEMBER_INFO>000022020830F85A99C86E4F41AC84767197DE1B6AC3C3FD52C4354F53825B30F61E7C3015</MEMBER_INFO>

 </ROW>

</RD_ORDER_DETAILSS>

 


  

 

6)      RD_ORDERS订单信息模型,如下:

 

<?xml version="1.0"?>

<RD_ORDERS>

 <ROW>

  <ORDER_ID>0001</ORDER_ID>

  <GOODS_NUMBER>4</GOODS_NUMBER>

  <TOTAL_PRICE>23</TOTAL_PRICE>

  <SETUP_TIME>2017-23-07</SETUP_TIME>

<ORDER_DETAILS>0000220208E611B44D00F44C299E8E37AE78D4CC04DED32AE083314F0DA4AF683A627A2E58</ORDER_DETAILS>

 </ROW>

 <ROW>

  <ORDER_ID>0002</ORDER_ID>

  <GOODS_NUMBER>4</GOODS_NUMBER>

  <TOTAL_PRICE>23</TOTAL_PRICE>

  <SETUP_TIME>2017-23-07</SETUP_TIME>

<ORDER_DETAILS>00002202084ED2795A47C8479B8C9D1010A2641A2CDED32AE083314F0DA4AF683A627A2E58</ORDER_DETAILS>

 </ROW>

</RD_ORDERS>

 


  

 

7)      RD_PAYMENT_TYPES支付类型信息模型,如下:

 

<?xml version="1.0"?>

<RD_PAYMENT_TYPES>

 <ROW>

  <PAYMENT_TYPE_ID>0001</PAYMENT_TYPE_ID>

  <PAYMENT_TYPE>支付宝</PAYMENT_TYPE>

 </ROW>

 <ROW>

  <PAYMENT_TYPE_ID>0002</PAYMENT_TYPE_ID>

  <PAYMENT_TYPE>微信</PAYMENT_TYPE>

 </ROW>

</RD_PAYMENT_TYPES>

 

  

 

 

 

 

六、实验总结

通过本实验,相关总结和经验收获,可分点总结如下:

  1. 本实验在XML逻辑设计阶段中,主要是利用PowerDesigner进行实体关系模型的设计,将实现的系统经过抽象后得到XSM模型;
  2. 在正式开始实验前,由于自身对XSM模型的绘制有所短缺,需得经过学习https://wenku.baidu.com/view/e104602652d380eb62946da7.html,即:XML模型及PowerDesigner实现的知识点后,形成了一定的认识,以及关于XSM模型如何绘制的相关知识体系;
  3. powerdesigner 绘制物理模型 关系箭头方向是子类指向父类;绘制概念模型的箭头方向与物理模型相反;
  4. 数据库德逻辑结构设计的结果不是唯一的,为了提高数据库应用系统的性能,还应该根据应用需要适当的修改,调整关系模式,这就是数据模型的优化。

Guess you like

Origin www.cnblogs.com/Raodi/p/12155659.html