PowerDesigner生成PHP代码

随着团队开发的普及,使用PowerDesigner来进行UML建模的朋友已经越来越多.在默认情况下可以由模型图直接可以生成JAVA/C#/C++等多种语言代码.但并不支持 PHP.
但是PowerDesigner可以通过语法文件插件的形式实现生成其他面向对象语言的代码.PHP已经有人帮我们写好了这一个语法文件了,我们要做的工作只是把它下载回来,复制到本地目录就可以了.

我们可以从sourcegorge上下载 php.xol 文件.下载地址:http://sourceforge.net/projects/papple/

也可以直接从本站下载: http://fatjames.extjs.org.cn/files/php.xol.zip

解压 php.xol.zip 后,把php.xol文件复制到PowerDesigner的安装目录 Resource Files\Object Languages 目录下面.默认路径为: “C:\Program Files\Sybase\PowerDesigner 12\Resource Files\Object Languages” .

PowerDesigner 生成 PHP 代码

PowerDesigner 生成 PHP 代码

生成结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5                                                          |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License,        |
// | that is available at http://www.php.net/license/3_0.txt.               |
// | If you did not receive a copy of the PHP license and are unable to     |
// | obtain it through the world-wide-web, please send a note to            |
// | license@php.net so we can mail you a copy immediately.                 |
// +------------------------------------------------------------------------+
// | Author:                                                                |
// +------------------------------------------------------------------------+
//
// $Id$
//
 
 
/**
* @author       Administrator
*/
class SurveyBus
{
 
    /**
    * @var      long
    */
    public $busId;
 
    /**
    * @var      String
    */
    public $routeNo;
 
    /**
    * @var      int
    */
    public $typeId;
 
    /**
    * @var      String
    */
    public $engName;
 
    /**
    * @var      String
    */
    public $chiName;
 
    /**
    * @var      String
    */
    public $bounds;
 
    /**
    * @var      int
    */
    public $distId;
 
    /**
    * @var      String
    */
    public $distCode;
 
    /**
    * @var      String
    */
    public $busDay;
 
    /**
    * @var      int
    */
    public $allSchNo;
 
    /**
    * @var      int
    */
    public $amSchNo;
 
    /**
    * @var      int
    */
    public $pmSchNo;
 
    /**
    * @var      Date
    */
    public $inputTime;
 
    /**
    * @var      Date
    */
    public $modifyTime;
 
    /**
    * @var      enum('yes','no')
    */
    public $delFlag;
}
 
?>
This entry was posted in 开发工具. Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word