PHP:通过源码自动生成UML类图

本文介绍了如何使用PHP_UML工具生成XMI文件,并通过ArgoUML导入这些文件进行进一步的UML建模。首先,通过指定输入路径和输出名称配置PHP_UML;然后设置UML版本并导出XMI文件;最后,在ArgoUML中打开XMI文件完成建模。
具体方法如下:
1、用PHP_UML生成XMI文件。关于PHP_UML可以从下面网址找到说明并下载
http://pear.php.net/manual/zh/package.php.php-uml.intro.php

下载解压后,按下面的例子使用
<?php
require_once 'PHP/UML.php';

$uml = new PHP_UML();   
$uml->setInput('joomla');               // this defines which files/folders to parse (here, the folder "tests")
$uml->parse('myApp');                  // this starts the parser, and gives the name "myApp" to the generated metamodel
$uml->generateXMI(1);             // UML version number (1 or 2)
$uml->export('xmi', 'myApp1.xmi');      // this serializes the metamodel in XMI code, and saves it to a file "myApp.xmi"
?>

2、用ArgoUML导入第一步生成的xmi文件即可。


转自:http://blog.sina.com.cn/s/blog_698b48a60100lws9.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值