﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-MDA之路-随笔分类-技术杂谈</title><link>http://www.blogjava.net/wxb_nudt/category/252.html</link><description>MDA,UML,XML,Eclipse及Java相关的Blog</description><language>zh-cn</language><lastBuildDate>Mon, 19 Nov 2007 00:12:30 GMT</lastBuildDate><pubDate>Mon, 19 Nov 2007 00:12:30 GMT</pubDate><ttl>60</ttl><item><title>C++的XML编程经验――LIBXML2库使用指南</title><link>http://www.blogjava.net/wxb_nudt/archive/2007/11/18/161340.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sun, 18 Nov 2007 01:42:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2007/11/18/161340.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/161340.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2007/11/18/161340.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/161340.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/161340.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 写这篇文章的原因有如下几点：1)C++标准库中没有操作XML的方法，用C++操作XML文件必须熟悉一种函数库，LIBXML2是其中一种很优秀的XML库，而且它同时支持多种编程语言；2)LIBXML2库的Tutorial写得不太好，尤其是编码转换的部分，不适用于中文编码的转换；3)网上的大多数关于Libxml2的介绍仅仅是翻译了自带的资料，没有详细介绍如何在windows平台下进行编程，更很少提到如何解决中文问题。&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2007/11/18/161340.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/161340.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2007-11-18 09:42 <a href="http://www.blogjava.net/wxb_nudt/archive/2007/11/18/161340.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Socket编程指南及示例程序</title><link>http://www.blogjava.net/wxb_nudt/archive/2007/11/01/157623.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Thu, 01 Nov 2007 15:20:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2007/11/01/157623.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/157623.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2007/11/01/157623.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/157623.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/157623.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 在一些常用的编程技术中，Socket网络编程可以说是最简单的一种。而且Socket编程需要的基础知识很少，适合初学者学习网络编程。目前支持网络传输的技术、语言和工具繁多，但是大部分都是基于Socket开发的，虽说这些“高级”的网络技术屏蔽了大部分底层实现，号称能极大程度的简化开发，而事实上如果你没有一点Socket基础，要理解和应用这些技术还是很困难的，而且会让你成为“半瓢水”。<br>例子代码就在我的博客中，包括六个UDP和TCP发送接受的cpp文件，一个基于MFC的局域网聊天小工具工程，和此小工具的所有运行时库、资源和执行程序。&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2007/11/01/157623.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/157623.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2007-11-01 23:20 <a href="http://www.blogjava.net/wxb_nudt/archive/2007/11/01/157623.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>纸黄金均价管理小软件—黄金秘书</title><link>http://www.blogjava.net/wxb_nudt/archive/2007/10/20/154584.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sat, 20 Oct 2007 15:13:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2007/10/20/154584.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/154584.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2007/10/20/154584.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/154584.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/154584.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 最近炒纸黄金，用的是工行的网上银行。但是不久就发现工行没有提供相应的均价管理工具，自己的均价和账面盈亏都得用笔记本写下来然后用计算器算。自己的历史盈亏等等信息也要用笔记本记下来。这样在原始社会混了几天后，终于忍不住写了一个小软件来管理纸黄金的均价、仓位、资金、历史盈亏、账面盈亏等信息，就叫做黄金秘书。<br>想试用这个小软件的，可以直接在我的博客下载这两个压缩包，解压后安装即可，安装和试用说明见下节：<br>&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2007/10/20/154584.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/154584.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2007-10-20 23:13 <a href="http://www.blogjava.net/wxb_nudt/archive/2007/10/20/154584.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java环境设置、HelloWorld例子、Ant环境及运行</title><link>http://www.blogjava.net/wxb_nudt/archive/2007/01/16/94268.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Tue, 16 Jan 2007 10:13:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2007/01/16/94268.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/94268.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2007/01/16/94268.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/94268.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/94268.html</trackback:ping><description><![CDATA[
		<p>一段时间不用Java，经常忘记一些烦琐的设置，特意写此文档备案。<br /><br />-------------<br />java环境设置<br />-------------</p>
		<p>在环境变量中设置以下三个变量：<br />JAVA_HOME=C:\j2sdk1.4.1 //可以改为相应的目录<br />CLASSPATH=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar<br />PATH=%JAVA_HOME%\bin;%PATH%</p>
		<p>然后在命令行输入java -version命令，如果出现<br />java version "1.4.1"<br />Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)<br />Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)<br />则说明已经配置成功！</p>
		<p>HelloWorld.java源程序如下：<br />public class HelloWorld{ <br /> public static void main(String[] args) {  <br />  System.out.println("Hello World!"); <br />  }<br />}</p>
		<p>在命令行执行javac HelloWorld.java<br />如果没有输出任何信息则说明编译成功。</p>
		<p>在命令行运行java HelloWorld，输出：<br />Hello World!<br />代表成功执行了java程序。</p>
		<p>-----------------<br />初学者常犯的错误<br />-----------------</p>
		<p>1. 运行时，带了.class后缀<br />如果你试图使用如下命令：<br />E:\java\src&gt;java HelloWorld.class<br />系统会误认为你运行的是HelloWorld包下的名为class的类文件，会到系统的CLASSPATH下（一般都包括当前目录）企图寻找HelloWorld.class.class这样的类，这样的类当然不存在了；并且也不可能存在，因为class是关键字，不能作为一个类的名字。所以会报如下错误信息：<br />Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld/class</p>
		<p>2. 文件名大小写错误<br />对于像Windows这样的系统，编译时可以不关心大小写。比如编译HelloWorld.java时，也可以使用：<br />E:\java\src&gt;javac helloworld.java<br />也可以编译通过，但产生的类文件仍然是和源文件相符的：HelloWorld.class。<br />但在运行时一定要注意大小写，比如试图使用如下命令运行：<br />E:\java\src&gt;java helloworld<br />将报类似于1中的错误：<br />Exception in thread "main" java.lang.NoClassDefFoundError: helloworld (wrong name: HelloWorld)</p>
		<p>
				<br />----------------------------<br />包含包层次的HelloWorld.java<br />----------------------------</p>
		<p>比如上面的HelloWorld.java修改如下：<br />package org.javaresearch;<br />public class HelloWorld{<br />public static void main(String[] args) {<br />System.out.println("Hello World!"); <br />}<br />}</p>
		<p>编译时有两种方法</p>
		<p>1. 直接编译<br />E:\java\src&gt;javac HelloWorld.java<br />此时在当前目录下输出HelloWorld.class。此时，运行不能使用上面相同的方法，使用：<br />E:\java\src&gt;java HelloWorld<br />运行时，出现如下错误：<br />Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: org/javaresearch/HelloWorld)<br />从上述错误信息你也可以看到，系统可以找到HelloWorld类（因为当前路径包含在CLASSPATH中，具体为什么会提示wrong name，有兴趣的朋友参见Java语言规范），但这个类属于org.javaresearch包。所以，你要做的就是按照上述包层次，相应的创建目录层次，把上面生成的HelloWorld.class放到E:\java\src\org\javaresearch\目录下。运行：<br />E:\java\src &gt;java org.javaresearch.HelloWorld<br />系统打印出：<br />Hello World!<br />这儿要注意的是，不能使用java org\javaresearch\HelloWorld来运行，此时同样会出现如下错误：<br />Exception in thread "main" java.lang.NoClassDefFoundError:org\javaresearch\HelloWorld (wrong name: org/javaresearch/HelloWorld)</p>
		<p>2. 使用 -d &lt;directory&gt;编译选项<br />是不是觉得上面的编译方法有点麻烦，能不能自动在当前路径（或任意指定的路径）下生成包层次呢？有！使用-d &lt;directory&gt;编译选项就能做到。<br />E:\java\src &gt;javac -d . HelloWorld.java<br />此时，在当前目录下就生成了一个org\javaresearch目录，并且输出的.class文件也在里面。运行：<br />E:\java\src &gt;java org.javaresearch.HelloWorld<br />系统打印：Hello World!<br />如果你想把生成的类文件集中存放在一个目录中，比如：E:\java\classes下，那么你首先创建这个目录，然后编译时：<br />E:\java\src &gt;javac -d E:\java\classes HelloWorld.java<br />就可以把生成的类文件放到E:\java\classes目录下，并且按照包层次相应的创建目录路径。你可以在E:\java\classes\org\javaresearch下找到HelloWorld.class文件。此时使用如下命令可以正确运行（注意如果要用到其它类，请在CLASSPATH中设好）：<br />E:\java\classes &gt;java org.javaresearch.HelloWorld</p>
		<p>或者你可以在E:\java目录下面运行以下命令来执行<br />E:\java &gt;java -classpath .\classes org.javaresearch.HelloWorld<br />使用java的-classpath参数可以将一些目录加入类路径</p>
		<p>-------------------<br />打包jar文件<br />-------------------<br />可以把一个包内的所有class文件打包为一个jar文件，便于存放和运行。以上文的org.javaresearch包为例，其打包命令如下：<br />E:\java\classes &gt;jar cvf wxb.jar org<br />会生成一个wxb.jar文件，将其中META-INF\MANIFEST.MF文件中添加如下一行：<br />Main-Class: org.javaresearch.HelloWorld<br />保存jar文件。</p>
		<p>或者首先创建并编辑一个MANIFEST.MF文件，其内容如下：<br />Manifest-Version: 1.0<br />Created-By: 1.4.1 (Sun Microsystems Inc.)<br />Main-Class: org.javaresearch.HelloWorld<br />将其保存到classes目录中<br />然后将其一起打包到jar文件中，打包命令如下：<br />E:\java\classes &gt;jar cvfm wxb.jar MANIFEST.MF org</p>
		<p>-------------<br />运行jar文件<br />-------------<br />在命令行中输入如下命令即可：<br />E:\java\classes &gt;java -jar wxb.jar<br />输出为：<br />Hello World!</p>
		<p>------------------------<br />用Ant来编译运行java程序<br />------------------------<br />首先安装Ant，步骤很简单：<br />1.将Ant压缩包解压到一个目录，例如D:\Ant1.5.2；<br />2.在环境变量中添加以下变量：<br />ANT_HOME=D:\Ant1.5.2  //可以改为相应的目录<br />3.修改Path环境变量<br />PATH=%ANT_HOME%\bin;%PATH%</p>
		<p>最后给出了一个Ant的build.xml文件，运行ant即可完成所有以上的编译和运行过程，其build文件如下：<br />&lt;project name="HelloWorld" default="jar" basedir="."&gt;<br />    &lt;description&gt;<br />        building HelloWorld!<br />    &lt;/description&gt;<br />  &lt;!-- set global properties for this build --&gt;<br />  &lt;property name="src" location="src"/&gt;<br />  &lt;property name="build" location="classes"/&gt;<br />  &lt;property name="dist"  location="dist"/&gt;<br />  &lt;property name="user.name" value="Wang Xuebin"/&gt;</p>
		<p>  &lt;target name="init"&gt;<br />    &lt;!-- Create the time stamp --&gt;<br />    &lt;tstamp/&gt;<br />    &lt;!-- Create the classes directory structure used by compile --&gt;<br />    &lt;mkdir dir="${build}"/&gt;<br />  &lt;/target&gt;</p>
		<p>  &lt;target name="build" depends="init"  description="build the source code" &gt;<br />    &lt;!-- Compile the java code from ${src} into ${build} --&gt;<br />    &lt;javac srcdir="${src}" destdir="${build}"/&gt;<br />  &lt;/target&gt;</p>
		<p>  &lt;target name="jar" depends="build"<br />        description="generate the distribution" &gt;<br />    &lt;!-- Create the distribution directory --&gt;<br />    &lt;mkdir dir="${dist}/lib"/&gt;</p>
		<p>    &lt;!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --&gt;<br />  &lt;jar destfile="${dist}/HelloWorld-${DSTAMP}.jar" basedir="${build}"&gt;<br />   &lt;manifest&gt;<br />    &lt;attribute name="Built-By" value="${user.name}"/&gt;<br />    &lt;attribute name="Main-Class" value="org.javaresearch.HelloWorld"/&gt;<br />   &lt;/manifest&gt;<br />  &lt;/jar&gt;  <br /> &lt;/target&gt;<br />  <br />  &lt;target name="run" depends="build" description="run HelloWorld"&gt;<br />    &lt;java classpath="${build}" classname="org.javaresearch.HelloWorld"&gt;&lt;/java&gt;<br />  &lt;/target&gt;</p>
		<p>  &lt;target name="runjar" depends="jar" description="run HelloWorld in jar file"&gt;<br />         &lt;java jar="${dist}/HelloWorld-${DSTAMP}.jar"<br />           fork="true"<br />           failonerror="true"<br />           maxmemory="128m"<br />           &gt;<br />         &lt;arg value="-h"/&gt;<br />         &lt;classpath&gt;<br />           &lt;pathelement location="${dist}/HelloWorld-${DSTAMP}.jar"/&gt;<br />           &lt;pathelement path="${java.class.path}"/&gt;<br />         &lt;/classpath&gt;<br />       &lt;/java&gt;<br />  &lt;/target&gt;<br />  <br />  &lt;target name="clean"<br />        description="clean up" &gt;<br />    &lt;!-- Delete the ${build} and ${dist} directory trees --&gt;<br />    &lt;delete dir="${build}"/&gt;<br />    &lt;delete dir="${dist}"/&gt;<br />  &lt;/target&gt;<br />&lt;/project&gt;</p>
		<p>
				<br /> </p>
<img src ="http://www.blogjava.net/wxb_nudt/aggbug/94268.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2007-01-16 18:13 <a href="http://www.blogjava.net/wxb_nudt/archive/2007/01/16/94268.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>形式化关系型模型转换方法的一些观点</title><link>http://www.blogjava.net/wxb_nudt/archive/2006/04/06/39691.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Thu, 06 Apr 2006 15:00:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2006/04/06/39691.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/39691.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2006/04/06/39691.html#Feedback</comments><slash:comments>11</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/39691.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/39691.html</trackback:ping><description><![CDATA[
		<h1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align="center">
				<span style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">形式化关系型模型转换方法的一些观点</span>
				<span lang="EN-US" style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
						</o:p>
				</span>
		</h1>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本文主要分析了</span>
				<span lang="EN-US">Michael Wahler</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的博士论文研究计划书</span>
				<span lang="EN-US">[1]</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，他是</span>
				<span lang="EN-US">IBM Zurich</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">研究室的一名走读博士。他的导师是</span>
				<span lang="EN-US">David Basin</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。他的研究题目是关系型模型转换方法的形式化。我将其中有意义的部分摘录出来。并加上了一些自己的想法和观点。这份计划书是</span>
				<span lang="EN-US">2004</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年写的，其中一些想法和观点今天看来也不失偏颇。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">今天又搜索了一下</span>
				<span lang="EN-US">Michael Wahler</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的论文，发现他除了这一篇以外，没有以第一作者的身份发表论文。很是遗憾，他的博士论文计划书做得很好，为什么没有成果出来呢？</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（蓝色部分是自己的观点和评论。）</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h2 style="MARGIN: 13pt 0cm">
				<span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">
						<font face="Arial">Background and Definitions<o:p></o:p></font>
				</span>
		</h2>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在第一部分</span>
				<span lang="EN-US">Background and Definitions</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，给出了四个概念</span>
				<span lang="EN-US">Model</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US">Transformation</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US">Consistency between Models</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US">Reconciliation</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。这些概念和其它地方的概念有一些区别，解释如下：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">Model</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
				<span lang="EN-US">
						<span style="mso-tab-count: 1">  </span>A model is a representation of a part of the function, structure and/or behavior of an application or system. A representation is said to be formal when it is based on a language that has a well-defined form (”syntax”), meaning (”semantics”), and possibly rules of analysis, inference, or proof for its constructs. The syntax may be graphical or textual.</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型是一个应用程序或者系统的功能，结构或者行为部分的一种表达方式。当一种表达方式基于一种含有良构的形式（语法），含义（语义），以及关于分析、推论或者证明其构造的规则的语言时，这种表达方式被称为形式化的。其语法可以是图形的或者是文本的。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事实上，目前对于软件模型的形式化表达，例如类图的形式化表达还是没有一个统一的标准或者语言。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">Transformation</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
				<span lang="EN-US">
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Functional View</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
				<span lang="EN-US"> A transformation is a function that maps a tuple of models from one or more</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">domains onto another tuple of models in the same or different domains.</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Operational View</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
				<span lang="EN-US"> A transformation is a terminating algorithm that applies structural and/or</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">semantic changes to a model or a set of models.</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于模型转换有两种观点：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">功能的观点：一个转换是一个函数，它可以将一组模型从一个或者更多的领域映射到相同或者不同领域中的另一组模型。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">操作的观点：一个转换是一个可停机算法，它将结构或者语义的变化应用到一个或者一组模型。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">描述性（</span>
				<span lang="EN-US" style="COLOR: #3366ff">declarative</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）的模型转换语言就是基于功能的观点；而命令性（</span>
				<span lang="EN-US" style="COLOR: #3366ff">imperative</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）的模型转换语言则是基于操作的观点。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">Consistency between models</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
				<span lang="EN-US">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">A set of models is consistent with respect to a consistency concept if the models fulfill the syntactic consistency conditions and the semantics of the models fulfills the semantic consistency conditions of the consistency concept.</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型一致性：如果一组模型符合语法一致性条件并且其语义符合某种一致性概念下的语义一致性条件，则这组模型对于这种一致性概念是一致的。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简单的理解：如果一组模型符合某种语法和语义的规则，则认为它们对于这组规则是一致的，也就是规则是成立的。最简单的语法一致性规则是，</span>
				<span lang="EN-US" style="COLOR: #3366ff">UML</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图的构建规则，例如类可以包含属性，但是属性不能包含类。如果一个</span>
				<span lang="EN-US" style="COLOR: #3366ff">UML</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型中属性包含了类，则此模型不是良构的，破坏了</span>
				<span lang="EN-US" style="COLOR: #3366ff">UML</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语法一致性规则。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">Reconciliation</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
				<span lang="EN-US">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">Reconciliation is the process of making inconsistent models consistent according to a consistency concept and the intent and expectation of the user. Depending on its requirements, the reconciliation process may run automatically or interactively.</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">消解（冲突消解）：消解是一种过程，其目的是为了将不一致的模型根据一致性概念和用户的决定和希望重新变为一致。根据其要求的不同，消解过程可以自动运行或者交互的运行。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">消解实际上就是模型转换过程，对于一组模型转换规则，如果源模型和目标模型是一致的，则它们符合规则，不需要转换。如果不符合规则，则需要消解</span>
				<span lang="EN-US" style="COLOR: #3366ff">/</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转换，通过将它们变为一致的过程（通常是对目标模型进行增、删、改）达到模型转换的目的。消解以后的模型则具有了一致性。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这种方法在</span>
				<span lang="EN-US" style="COLOR: #3366ff">MTF</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US" style="COLOR: #3366ff">IBM</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的模型转换工具）中实现了。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h2 style="MARGIN: 13pt 0cm">
				<span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">
						<font face="Arial">Running Example<o:p></o:p></font>
				</span>
		</h2>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第二部分给出了一个模型转换的实例如下：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /?>
						<v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600">
								<v:stroke joinstyle="miter">
								</v:stroke>
								<v:formulas>
										<v:f eqn="if lineDrawn pixelLineWidth 0">
										</v:f>
										<v:f eqn="sum @0 1 0">
										</v:f>
										<v:f eqn="sum 0 0 @1">
										</v:f>
										<v:f eqn="prod @2 1 2">
										</v:f>
										<v:f eqn="prod @3 21600 pixelWidth">
										</v:f>
										<v:f eqn="prod @3 21600 pixelHeight">
										</v:f>
										<v:f eqn="sum @0 0 1">
										</v:f>
										<v:f eqn="prod @6 1 2">
										</v:f>
										<v:f eqn="prod @7 21600 pixelWidth">
										</v:f>
										<v:f eqn="sum @8 21600 0">
										</v:f>
										<v:f eqn="prod @7 21600 pixelHeight">
										</v:f>
										<v:f eqn="sum @10 21600 0">
										</v:f>
								</v:formulas>
								<v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f">
								</v:path>
								<o:lock aspectratio="t" v:ext="edit">
								</o:lock>
						</v:shapetype>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<img height="154" alt="image001.gif" src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/形式化关系型模型转换方法的一些观点/image001.gif" width="387" border="0" />
						<br />然后给出了一个关系型的模型转换代码（可以看出，这就是</span>
				<span lang="EN-US">MTF</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的代码）：</span>
		</p>
		<div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0cm; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 1pt; MARGIN-LEFT: 17.95pt; BORDER-LEFT: windowtext 1pt solid; MARGIN-RIGHT: 0cm; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt">
				<p class="sourcecode11212" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0cm; mso-para-margin-left: 1.71gd">
						<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: #d9d9d9; mso-fareast-font-family: 宋体; mso-shading: white; mso-pattern: gray-15 auto">
								<font face="Courier New">relate R (Class c1, Class c2) {<o:p></o:p></font>
						</span>
				</p>
				<p class="sourcecode11212" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0cm; mso-para-margin-left: 1.71gd">
						<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: #d9d9d9; mso-fareast-font-family: 宋体; mso-shading: white; mso-pattern: gray-15 auto">
								<font face="Courier New">relateAttributes(c1.attributes, c2.attributes), (1)<o:p></o:p></font>
						</span>
				</p>
				<p class="sourcecode11212" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0cm; mso-para-margin-left: 1.71gd">
						<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: #d9d9d9; mso-fareast-font-family: 宋体; mso-shading: white; mso-pattern: gray-15 auto">
								<font face="Courier New">relateMethods(c1.methods, c2.methods), (2)<o:p></o:p></font>
						</span>
				</p>
				<p class="sourcecode11212" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0cm; mso-para-margin-left: 1.71gd">
						<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: #d9d9d9; mso-fareast-font-family: 宋体; mso-shading: white; mso-pattern: gray-15 auto">
								<font face="Courier New">relateGetter(c1.attributes, c2.methods) (3)<o:p></o:p></font>
						</span>
				</p>
				<p class="sourcecode11212" style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; BACKGROUND: #d9d9d9; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0cm; mso-para-margin-left: 1.71gd">
						<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: #d9d9d9; mso-fareast-font-family: 宋体; mso-shading: white; mso-pattern: gray-15 auto">
								<font face="Courier New">}<o:p></o:p></font>
						</span>
				</p>
		</div>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当然，文中给出的代码是不完整的，可能作者不想牵扯到太多</span>
				<span lang="EN-US" style="COLOR: #3366ff">MTF</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的细节，毕竟这是一个博士开题报告，在没有对所有的关系型模型转换语言进行分析之前，就使用</span>
				<span lang="EN-US" style="COLOR: #3366ff">MTF</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也是不恰当的。因此他还给出了基于一阶逻辑的转换定义：</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<img height="214" alt="image002.gif" src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/形式化关系型模型转换方法的一些观点/image002.gif" width="554" border="0" />
						<br />一阶逻辑用来表示模型转换的语义是足够的，</span>
				<span lang="EN-US" style="COLOR: #3366ff">OCL</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言其实是一阶逻辑的另一种表现形式，所以有一些研究者将</span>
				<span lang="EN-US" style="COLOR: #3366ff">OCL</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做为模型转换语言。其实一阶逻辑看起来还是很清爽的，比具体的模型转换代码更好理解。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h2 style="MARGIN: 13pt 0cm">
				<span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">
						<font face="Arial">Related Work<o:p></o:p></font>
				</span>
		</h2>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关工作包括</span>
				<span lang="EN-US">MDA</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、业务过程集成与自动化（</span>
				<span lang="EN-US">Business Process Integration and Automation</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）、形式化语言的语法和语义、数据库修订理论（</span>
				<span lang="EN-US">Database Revision Theory</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">其中业务过程集成与自动化不太了解，数据库修订理论是和人工智能领域相关的，也不太理解。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h2 style="MARGIN: 13pt 0cm">
				<span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">
						<font face="Arial">State of the Art<o:p></o:p></font>
				</span>
		</h2>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这一节介绍目前模型转换的研究现状。一共有三点内容：第一介绍了模型转换技术出现的动机；第二部分介绍了模型转换技术的分类，分类方法来自</span>
				<span lang="EN-US" style="COLOR: #3366ff">[2]</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；第三部分介绍了目前的关系型模型转换方法，其中最著名的是</span>
				<span lang="EN-US" style="COLOR: #3366ff">[3]</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，他第一次使用集合论中的关系来表示元模型间的转换规则。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h2 style="MARGIN: 13pt 0cm">
				<span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">
						<font face="Arial">Open Questions and Tasks<o:p></o:p></font>
				</span>
		</h2>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这是本文最有意义的一节了，其中介绍了关系型模型转换语言形式化领域中的两个</span>
				<span lang="EN-US" style="COLOR: #3366ff">open question</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">1. The syntax and semantics of the expression language that is used to formulate the set comprehension predicate has to be defined and its logical properties have to be proved. As one single language will not be sufficient for the several use cases for transformations, several languages which map to distinct logical classes have to be investigated.</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用来阐明集合理解断言（</span>
				<span lang="EN-US">set comprehension predicate</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，用来表达模型转换规则的关系往往使用集合理解断言来定义）的语言的语法和语义必须被定义好，它的逻辑属性也必须验证。因为单一的语言不足以表达模型转换中的各种使用案例，所以必须研究多种语言，它们分别映射到不同的逻辑类型。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">总的来说，作者希望通过研究不同的语言来找到适合描述模型转换规则的关系型语言，或者自己定义这种语言的语法和语义。这些语言都应该是基于某种逻辑的。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">2. An execution semantics needs to be defined for relations in the model transformation context. The semantics needs to support two mechanisms:<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">(a) Two or more models have to be checked for consistency, i.e., that they form a valid tuple with respect to a relation that was defined on them.<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">(b) Reconciliation has to be supported to be able to ”repair” models that are inconsistent with respect to a relation.<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在模型转换环境中，必须定义关系的可执行语义。这种语义必须支持以下两种机制：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
						<span style="mso-list: Ignore">(a)<span style="FONT: 7pt 'Times New Roman'">    </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">两个或者更多的模型必须能够进行一致性检查。例如，根据定义在它们之上的一个关系来检查他们是否构成了一个有效的组合。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
						<span style="mso-list: Ignore">(b)<span style="FONT: 7pt 'Times New Roman'">    </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果模型不符合一个关系定义的一致性，则必须有一个消解机制来“修复”模型。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作者希望能够定义一个基于关系的可执行语义，这个语义有两种功能：一是检查模型之间是否能够保持一致性，这里的一致性使用关系来定义，即用关系定义的模型转换规则；二是当模型不一致时，是否可以使用消解机制来修复模型从而重新达到一致。这里的消解机制相当于模型转换的执行机制。而消解的过程就是模型转换的执行过程。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h3 style="MARGIN: 13pt 0cm">
				<span style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">理想的关系型模型转换语言的重要特征</span>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%">
						<o:p>
						</o:p>
				</span>
		</h3>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在这一节作者还列举了关系型模型转换语言应该具有的某些重要特征，主要包括：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Termination</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（可停机性）：模型转换方法应该保证是可以停机的，不能包含死循环等。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Confluence</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（汇合？）：关系的执行顺序是否对模型转换的结果造成影响？在关系之间是否存在着显式、隐式的控制流？两个关系的域并行执行并且有交集时，是否会导致问题？</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般的关系型模型转换语言的执行顺序是隐式的被定义的，例如</span>
				<span lang="EN-US" style="COLOR: #3366ff">MTF</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，它从第一个可以执行的</span>
				<span lang="EN-US" style="COLOR: #3366ff">relate</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语句开始，然后在语句中调用其它子语句。在</span>
				<span lang="EN-US" style="COLOR: #3366ff">QVT</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">草案</span>
				<span lang="EN-US" style="COLOR: #3366ff">[4]</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，</span>
				<span lang="EN-US" style="COLOR: #3366ff">Relation</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言将所有的</span>
				<span lang="EN-US" style="COLOR: #3366ff">top Relation</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语句依次执行，然后在语句中调用其它子语句。而在其它的一些模型转换语言中例如</span>
				<span lang="EN-US" style="COLOR: #3366ff">ATL</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，则类似于一般的面向对象语言，是显式定义执行顺序的。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Composition</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（组合）：将关系组合起来时是否会导致问题？当然，由于关系是描述性的，所以它是没有副作用的，因此组合关系应当是没有问题的。但是这一点如何证明？</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="COLOR: #3366ff">OCL</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也是描述性的语言，它最大的特点就是无副作用，并且它的计算都被认为是原子的，不存在并行和多线程等问题。但是如何证明关系的组合不会带来副作用还真是没有人想过。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Correctness / Decidability</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（正确性</span>
				<span lang="EN-US">/</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可判定性）：如何处理转换规范中可能存在的矛盾。集合理解断言可能会含有一些矛盾，它们应该可以被静态的检测出来。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Multi-Directionality</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（多向性）：转换是否能够被双向的执行，并且不丢失信息。双向转换要求关系必须是一个双射（</span>
				<span lang="EN-US">bijective</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），对于某个语言，一个关系的双射性质能否静态的计算出来？</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">In-Place Transformations</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（内置转换（这个词是我发明的，哈哈！））：内置转换能否使用数学关系的方式表达出来？它可能会需要一个状态的概念，一个关系型语言如何支持这种状态的概念？</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">内置转换也被称为模型进化，意思就是源模型与目标模型是同一个模型。当执行这种转换时显然要复杂一些，因为规则执行的时候是互相影响的，当某一条规则执行时，也许破坏了前面规则定义的一致性。所以可能会需要一个状态来描述模型元素或者规则的执行情况。目前内置转换的研究不多。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">Usability</span>
				</b>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（可用性）：一个模型转换语言是否能够适应多种不同类型的转换？即使是很简单的转换规则，使用关系来表述也许是冗长的。语言能否提供一些语法上的简化机制？</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目前看来，全部符合以上七点的关系型模型转换语言还没有出现，</span>
				<span lang="EN-US" style="COLOR: #3366ff">QVT</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范</span>
				<span lang="EN-US" style="COLOR: #3366ff">[4]</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">已经出台，我认为它解决了</span>
				<span lang="EN-US" style="COLOR: #3366ff">Confluence</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US" style="COLOR: #3366ff">Composition</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US" style="COLOR: #3366ff">Correctness/Decidability</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US" style="COLOR: #3366ff">Muti-Directionality</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US" style="COLOR: #3366ff">Usability</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。没有涉及到</span>
				<span lang="EN-US" style="COLOR: #3366ff">Termination</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US" style="COLOR: #3366ff">In-Place Transformations</span>
				<span style="COLOR: #3366ff; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。另外，它也没有对这些性质做相关的证明。</span>
				<span lang="EN-US" style="COLOR: #3366ff">
						<o:p>
						</o:p>
				</span>
		</p>
		<h2 style="MARGIN: 13pt 0cm">
				<span style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">总结</span>
				<span lang="EN-US" style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">
						<o:p>
						</o:p>
				</span>
		</h2>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这篇文章的最大贡献就是提出了那两个</span>
				<span lang="EN-US">open question</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。并进行了相关的分析。提炼如下：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第一个问题是：如何定义或者选择一个适于表达模型转换规则的关系型语言？它是以某种形式化逻辑做为基础的，并且具有上述的七个特性。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第二个问题是：如果定义这种关系型模型转换语言的执行语义？这里分为两个子问题，第一是如何检测模型之间的不一致性；第二是如何使用消解机制来修复模型。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从去年年底开始使用</span>
				<span lang="EN-US">EndNote</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来管理参考文献了，这个东东真的不错啊。现在随手加参考文献的感觉真是爽！</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -36pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">[1]<span style="mso-tab-count: 1">           </span>Wahler, Michael. Formalizing Relational Model Transformation Approaches. Zurich, 2004 <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -36pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">[2]<span style="mso-tab-count: 1">           </span>Krzysztof Czarnecki, Simon Helsen. <i style="mso-bidi-font-style: normal">Classification of Model Transformation Approaches</i>. In: <i style="mso-bidi-font-style: normal">Proceedings of the 18th International Conference, OOPSLA’2003, Workshop on Generative Techniques in the context of Model Driven Architecture</i>. Anaheim, California, USA 2003<span style="mso-spacerun: yes">  </span><o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -36pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">[3]<span style="mso-tab-count: 1">           </span>Kent, David Akehurst and Stuart. <i style="mso-bidi-font-style: normal">A Relational Approach to Defining Transformations in a Metamodel</i>. In: H. Hussmann J.-M. Jézéquel, S. Cook (Eds.). <i style="mso-bidi-font-style: normal">UML 2002 - The Unified Modeling Language 5th International Conference</i>. Dresden, Germany: Springer-Verlag 2002 LNCS 2460.243-258 <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -36pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">[4]<span style="mso-tab-count: 1">           </span>OMG, <i style="mso-bidi-font-style: normal">MOF QVT Final Adopted Specification.</i> 2005.<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -36pt">
				<span lang="EN-US">
						<span style="COLOR: #3366ff">
								<o:p> </o:p>
						</span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/wxb_nudt/aggbug/39691.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2006-04-06 23:00 <a href="http://www.blogjava.net/wxb_nudt/archive/2006/04/06/39691.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一个XSLT的变量、参数和模板调用的问题</title><link>http://www.blogjava.net/wxb_nudt/archive/2006/03/08/34377.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Wed, 08 Mar 2006 14:52:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2006/03/08/34377.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/34377.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2006/03/08/34377.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/34377.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/34377.html</trackback:ping><description><![CDATA[<P class=2 style="MARGIN: 13pt 0cm 13pt 14.2pt"><SPAN lang=EN-US style="mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><STRONG><FONT face=Arial>1.</FONT></STRONG><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><STRONG>问题</STRONG></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">昨天遇到了这样一个</SPAN><SPAN lang=EN-US>xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文档，如下：</SPAN><SPAN lang=EN-US>bookObject.xml</SPAN></P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #cccccc; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt">
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;?xml version="1.0" encoding="ASCII"?&gt;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;?xml-stylesheet type="text/xsl" href="Book2PubXSLT.xsl"?&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;Book title="WxbBook"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;chapters nbPages="12" title="chapter1" author="author1"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;chapters nbPages="15" title="chapter2" author="author2"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;chapters nbPages="20" title="chapter3" author="author3"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;/Book&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;Book title="nextBook"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;chapters nbPages="10" title="chapter1" author="aaa"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;chapters nbPages="20" title="chapter2" author="bbb"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;chapters nbPages="30" title="chapter3" author="ccc"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;/Book&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;/xmi:XMI&gt;<o:p></o:p></FONT></SPAN></P></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">希望能够使用</SPAN><SPAN lang=EN-US>XSLT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转换为这样的一个</SPAN><SPAN lang=EN-US>xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文档（目的是为了做一个很简单的模型转换实例，当然这点和本文主题几乎无关）：</SPAN><SPAN lang=EN-US>publicationObject.xml</SPAN></P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #cccccc; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt">
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;?xml version="1.0" encoding="ASCII"?&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="Publication"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;Publication title="nextBook" nbPages="60" authors="ccc and aaa and bbb"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;Publication title="WxbBook" nbPages="47" authors="author3 and author1 and author2"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;/xmi:XMI&gt;<o:p></o:p></FONT></SPAN></P></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分析这两个文档可以看出，希望的转换规则如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN lang=EN-US>Book</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">节点有一个属性</SPAN><SPAN lang=EN-US>title</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，它等于</SPAN><SPAN lang=EN-US>Publication</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的节点属性</SPAN><SPAN lang=EN-US>title</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN lang=EN-US>Book</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">节点包含</SPAN><SPAN lang=EN-US>chapters</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">子节点，每个子节点都有三个属性。其中一个</SPAN><SPAN lang=EN-US>Book</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">节点的所有</SPAN><SPAN lang=EN-US>chapters</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">子节点的</SPAN><SPAN lang=EN-US>nbPages</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性相加等于</SPAN><SPAN lang=EN-US>Publication</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>nbPages</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一个</SPAN><SPAN lang=EN-US>Book</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">节点的所有</SPAN><SPAN lang=EN-US>chapters</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">子节点的</SPAN><SPAN lang=EN-US>author</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相连，并在中间插入</SPAN><SPAN lang=EN-US>and</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">则等于</SPAN><SPAN lang=EN-US>Publication</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>authors</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由于之前我并没有接触过</SPAN><SPAN lang=EN-US>XSLT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的变量、参数和</SPAN><SPAN lang=EN-US>xsl:call-template</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等概念，所以还是颇费了一点时间来解决此问题。</SPAN></P>
<P class=2 style="MARGIN: 13pt 0cm 13pt 14.2pt"><SPAN lang=EN-US style="mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><STRONG><FONT face=Arial>2.</FONT></STRONG><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><STRONG>问题的解决</STRONG></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值得注意的有几点：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 50.25pt; TEXT-INDENT: -29.25pt; mso-list: l0 level2 lfo1; tab-stops: list 50.25pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>XSLT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的变量一次赋值后是不能改变的，所以这里的变量几乎等于其它语言中的常量。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 50.25pt; TEXT-INDENT: -29.25pt; mso-list: l0 level2 lfo1; tab-stops: list 50.25pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>template</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有两种，常见的是通过</SPAN><SPAN lang=EN-US>&lt;xsl:template match="/"&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的方式定义的，使用</SPAN><SPAN lang=EN-US>match</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性。调用的时候是使用</SPAN><SPAN lang=EN-US>&lt;xsl:apply-templates select=""/&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。另一种</SPAN><SPAN lang=EN-US>template</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类似与其它语言中的函数调用，使用</SPAN><SPAN lang=EN-US>&lt;xsl:template name=”t_name”&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来定义，调用的时候使用</SPAN><SPAN lang=EN-US>&lt;xsl:call-template name=" t_name "/&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来调用。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 50.25pt; TEXT-INDENT: -29.25pt; mso-list: l0 level2 lfo1; tab-stops: list 50.25pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在第二种</SPAN><SPAN lang=EN-US>template</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的定义中可以加入参数，类似于其它编程语言中的参数列表。在调用时也可以传入具体的值做为实参。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 50.25pt; TEXT-INDENT: -29.25pt; mso-list: l0 level2 lfo1; tab-stops: list 50.25pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由于</SPAN><SPAN lang=EN-US>XSLT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不包含</SPAN><SPAN lang=EN-US>for</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>while</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等循环语句。当简单的</SPAN><SPAN lang=EN-US>for-each</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不能满足要求时。则需要使用递归</SPAN><SPAN lang=EN-US>template</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">调用来完成其它语言中的循环。从</SPAN><SPAN lang=EN-US>functional programming</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的理论中我们知道这二者是等价的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下面是进行转换的</SPAN><SPAN lang=EN-US>XSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文档：</SPAN><SPAN lang=EN-US>Book2PubXSLT.xsl</SPAN></P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #cccccc; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt">
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;?xml version="1.0" encoding="ASCII"?&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xmi="http://www.omg.org/XMI"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xsl:template name="left"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xsl:text disable-output-escaping="yes"&gt;&amp;lt;&lt;/xsl:text&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;/xsl:template&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xsl:template name="right"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;xsl:text disable-output-escaping="yes"&gt;&amp;gt;&lt;/xsl:text&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;/xsl:template&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><o:p><FONT size=2>&nbsp;</FONT></o:p></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;xsl:template match="/"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;xsl:call-template name="left"/&gt;xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="Publication"&lt;xsl:call-template name="right"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:apply-templates select="xmi:XMI"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:call-template name="left"/&gt;/xmi:XMI&lt;xsl:call-template name="right"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;/xsl:template&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 1"></SPAN><o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;xsl:template match="xmi:XMI"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:for-each select="Book"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:call-template name="left"/&gt;Publication title="&lt;xsl:value-of select="@title"/&gt;" <o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>nbPages ="&lt;xsl:value-of select="sum(chapters/@nbPages)"/&gt;"<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>authors ="<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:call-template name="concatAuthor"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:with-param name="str" select="chapters/@author"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:with-param name="index" select="1"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:with-param name="nodenum" select="last()+1"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/xsl:call-template&gt;"/&lt;xsl:call-template name="right"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/xsl:for-each&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;/xsl:template&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 1"></SPAN><o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;xsl:template name="concatAuthor"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:param name="str"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:param name="index"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:param name="nodenum"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:choose&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:when test="$index != $nodenum"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:call-template name="concatAuthor"&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><FONT size=2><SPAN lang=EN-US><SPAN style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:with-param name="str" select="concat($str,' and ',chapters</SPAN><?xml:namespace prefix = st1 ns = "isiresearchsoft-com/cwyw" /><st1:citation><SPAN lang=EN-US>[$index+1]</SPAN></st1:citation><SPAN lang=EN-US>/@author)"/&gt;<o:p></o:p></SPAN></FONT></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:with-param name="index" select="$index + 1"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:with-param name="nodenum" select="$nodenum"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/xsl:call-template&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/xsl:when&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:otherwise&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;xsl:value-of select="$str"/&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/xsl:otherwise&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/xsl:choose&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"></SPAN><FONT size=2>&lt;/xsl:template&gt;<o:p></o:p></FONT></SPAN></P>
<P class=SourceCode205052 style="BACKGROUND: #cccccc; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt"><SPAN lang=EN-US><FONT size=2>&lt;/xsl:stylesheet&gt;<o:p></o:p></FONT></SPAN></P></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从上面可以看出，解决问题最主要的一点就是使用了一个递归模板</SPAN><SPAN lang=EN-US>concatAuthor</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，它带有三个参数</SPAN><SPAN lang=EN-US>str</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>index </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>nodenum</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，分别表示连接的字符串、迭代子和</SPAN><SPAN lang=EN-US>chapters</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的节点数。通过这种方法，熟悉递归的人可以很快的写出几乎和</SPAN><SPAN lang=EN-US>javascript</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等价的种种数据操作。当然，由于变量不能赋值、参数只能以递归的方式来改动，还是很不方便的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">其优点也是明显的，不依赖其它脚本语言完成了数据操作。可以在所有</SPAN><SPAN lang=EN-US>xsl</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">引擎上面运行。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<P class=2 style="MARGIN: 13pt 0cm 13pt 14.2pt"><SPAN lang=EN-US style="mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><STRONG><FONT face=Arial>3.</FONT></STRONG><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><STRONG><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">小结</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></STRONG></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 2.85pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-para-margin-left: .27gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">深入讲解</SPAN><SPAN lang=EN-US>XSLT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的中文文献不多，大多数是入门级的。当我半猜半试的解决了这个问题后。发现了在</SPAN><SPAN lang=EN-US>O’Reilly</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有一本《</SPAN><SPAN lang=EN-US>XSLT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">》的书，其中列出了这样的内容。<BR></SPAN><SPAN lang=EN-US><o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 哦，今天是女孩节，祝我的乖老婆和乖乖女儿节日快乐，身体健康啦！<BR>既然这么高兴，就贴一张刚刚照的雯雯百日照好了。<BR><IMG height=448 alt=11.JPG src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/baby/11.JPG" width=640 border=0></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/34377.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2006-03-08 22:52 <a href="http://www.blogjava.net/wxb_nudt/archive/2006/03/08/34377.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MDA中模型的存储、表现与转换</title><link>http://www.blogjava.net/wxb_nudt/archive/2006/02/13/30505.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Mon, 13 Feb 2006 13:08:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2006/02/13/30505.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/30505.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2006/02/13/30505.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/30505.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/30505.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: MDA中模型的存储、表现与转换最近一些朋友在我的blog上面留言或者给我写email讨论一些问题，本文希望能够一起解答他们的一些疑问，同时也整理一下自己的思路。MDA是以模型为中心的，模型是其基本元素，所以关于模型的存储、查询、表现和转换是对于基本元素的操作。OMG已经有一些既定规范或者正在制订的规范是用来讨论这些问题的。例如XMI规范规定了模型的存储格式、QVT规范（正在制订中，已经有一...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2006/02/13/30505.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/30505.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2006-02-13 21:08 <a href="http://www.blogjava.net/wxb_nudt/archive/2006/02/13/30505.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>惊讶中发现BLOGJAVA的赞助商竟然是gentleware！</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/12/24/25297.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sat, 24 Dec 2005 04:56:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/12/24/25297.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/25297.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/12/24/25297.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/25297.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/25297.html</trackback:ping><description><![CDATA[无聊中逛blogjava主页时发现顶头的赞助商竟然是gentleware，proseidon的出产者。汗。。。<BR>想起了前几天我干的一件很猥琐的事情。<BR>前几天写文章要画元模型图，受到一位牛人的影响，决定用proseidon画一把，下载了一个免费版本，兴高采烈的画好了，真是方便啊，比visio，rose之流好多了。但是，导出图像一看，晕倒。。。如下：<BR><IMG height=401 alt=CWMRdlModel.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/关于Proseidon/CWMRdlModel.jpg" width=593 border=0><BR>这个怎么办啊，买个正版没钱，于是，在画笔里面用刷子刷啊刷，发现那是徒劳的。<BR>无奈之中，在Proseidon中截屏，然后将图像剪切出来，这样图像没有那个人物背景，<BR>然后再用画笔一刷，呼呼，终于搞定了：<BR><IMG height=401 alt=CWMRDL.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/关于Proseidon/CWMRDL.jpg" width=582 border=0><BR>以上做法，请勿效仿，汗。。。。。。。。。<BR>我认识到这样是不对的，然后就去下载MagicDraw了，这些图片我不会在正式场合使用的，请<BR>gentleware原谅我。<BR>注：上面是我从CWM规范中裁减出来的relation包的元模型图。嘿嘿！<img src ="http://www.blogjava.net/wxb_nudt/aggbug/25297.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-12-24 12:56 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/12/24/25297.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>模型转换语言ATL使用感想</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/12/20/24826.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Tue, 20 Dec 2005 09:48:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/12/20/24826.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/24826.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/12/20/24826.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/24826.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/24826.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1.&nbsp;&nbsp;&nbsp;&nbsp; ATL简介ATL是ATLAS转换语言的简称，它是ATLAS研究组开发出来的一种符合OMG的一个QVT提案的模型转换语言。目前ATL已经实现为ADT的一个组成部分，ADT是一个Eclipse插件，他是著名的Eclipse项目GMT的子项目。ATL是基于EMF（Eclipse模型框架）的，其元模型、模型都是用EMF来描述的。从本质上来说，A...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/12/20/24826.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/24826.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-12-20 17:48 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/12/20/24826.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MDA的阵营划分</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/12/12/23512.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Mon, 12 Dec 2005 08:53:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/12/12/23512.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/23512.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/12/12/23512.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/23512.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/23512.html</trackback:ping><description><![CDATA[<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">MDA</SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的阵营划分</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H1>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提出已经有</SPAN><SPAN lang=EN-US>5,6</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年的历史了，其主要标准还是</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（包括</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>CWM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">四大核心。目前正在制订的标准还有</SPAN><SPAN lang=EN-US>QVT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（即模型的查询、视图和转换）。这些标准族之间相互关联共同组成了</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个庞大的体系结构。可以说，</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是由系列的标准族加上模型驱动开发的思想共同组成的。而后续的研究者根据自己的兴趣又有了不同的侧重点，导致了</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的分裂（划分？）。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">四个阵营</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><A href="http://blogs.msdn.com/stevecook/archive/2004/10/27/248322.aspx">Steve Cook</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">研究者划分为三个阵营，</SPAN><SPAN lang=EN-US><A href="http://www.martinfowler.com/articles/mdaLanguageWorkbench.html">Martin Flower</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也同意他的观点，并针对这三个阵营对待</SPAN><SPAN lang=EN-US>Language workbench</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的态度进行了详细的讨论。另外，</SPAN><SPAN lang=EN-US>Martin</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还提出了一个</SPAN><SPAN lang=EN-US>MDD</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营。总结他们两个人的意见，可以将</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营划分为四个部分，其中有的阵营是完全对立的，而有的则是兼容并蓄的：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>UML PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营：使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来建立</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，然后利用模型转换来生成</SPAN><SPAN lang=EN-US>PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，最后用</SPAN><SPAN lang=EN-US>PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">生成代码；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营：不使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，而用</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来代替，建模语言和模型转换都使用</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来定义；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可执行的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营：建立</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编译器，将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直接作为编程语言，使</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以执行。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（以上来自于</SPAN><SPAN lang=EN-US>Steve Cook</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，原文如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>1. The UML PIM camp: MDA involves the use of UML to build Platform Independent Models (PIMs) which are transformed into Platform Specific Models (PSMs) from which code is generated.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>2. The MOF camp: MDA does not involve the use of UML, but instead the crucial technology is MOF, and the definition of modelling languages and language transformations using MOF.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>3. The Executable UML camp: MDA involves building a UML compiler, making it a first class programming language.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>MDD</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Model Driven Development</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）阵营：他们也可以说不属于</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的阵营，因为他们并不关心</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">系列规范。他们关注的是模型驱动的开发思想，可以说，</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">就是</SPAN><SPAN lang=EN-US>MDD</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范上面的实现。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也有部分</SPAN><SPAN lang=EN-US><A href="http://www.donews.net/xzwenlan/archive/2005/01/20/249498.aspx"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">研究者</SPAN></A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">划分为狭义和广义的两个阵营。同上面的联系起来看，狭义的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">即前三个阵营，而广义的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">即</SPAN><SPAN lang=EN-US>MDD</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营。我是这么认为的。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>UML PIM</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">阵营</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营可以说是目前最强大的，因为它是如此符合</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最初的构想，从大家了解最多的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开始建立</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，然后转换为</SPAN><SPAN lang=EN-US>PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（例如</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>J2EE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），然后生成代码，一切看来都如此流畅，和以前出现的技术可以兼容，并且也不缺少工具和厂商的支持。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">但是，它也是受到诟病最多的一个阵营，一个最大的问题就是关于</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否是平台无关的问题，如果</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不是平台无关的，则显然它不适合用来构建</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的人对于</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的抛弃就是基于这个原因，他们认为</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">才是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的本源，过多的使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">会导致不能真正的构建</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，因为</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本身就是一个平台。我觉得关于平台无关的争论可以休矣，当初</SPAN><SPAN lang=EN-US>C</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也是被认为平台无关的，只要在不同的操作系统上重新编译一次即可；后来的</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也号称一举解决了网络平台不兼容的问题；再来就是</SPAN><SPAN lang=EN-US>J2EE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。可是，当你解决了上一个平台相关问题时，你所创建的新技术同时变成了一个新的平台，如</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台，</SPAN><SPAN lang=EN-US>J2EE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台等。为了解决不同的</SPAN><SPAN lang=EN-US>CPU</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">硬件平台不兼容，发明了操作系统；为了解决不同的操作系统问题，发明了高级语言；为了解决网络不兼容问题，发明了中间件；为了解决中间件不兼容的问题，发明了</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>web service</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等等技术。目前看来，使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来建立的模型基本上具有平台无关性，我（我是属于</SPAN><SPAN lang=EN-US>UML PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的）认为使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来建立</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是合适的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的另一个问题是，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">过于繁琐，</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标准充斥着各种各样作用不大的填充物，不仅没有能够让</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">更加实用，反而导致了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的复杂度增加，可用性下降。就好比要使用一个锤子，但是</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">给出了一整个房间的工具，在里面翻了半天却没有找到一把合适的锤子。唉。。。因此</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的人就决定自己去造一把锤子，反正它和</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一样，都贴有</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出品的标签。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当目前的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不能完全满足需要时，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">给出了标准的扩充机制，也就是</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（包括</SPAN><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>tagged value</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。但是，很多人认为</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的扩充机制和</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自身一样，过于复杂，还不如用</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">重新构建一个建模语言（我倒不这么认为，感觉</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还是比较简单的）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还有一个不能回避的问题是，</SPAN><SPAN lang=EN-US>UML PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营更加注重系统的结构，而不注重（不能解决）系统的语义（动作</SPAN><SPAN lang=EN-US>/</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">流程），因此很多人倾向于去掉</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">动作语义，或者根本不使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">动作语义。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">尽管</SPAN><SPAN lang=EN-US>UML PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有这么多的缺点，但是其优点也是显而易见的：</SPAN><SPAN lang=EN-US>1.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">符合标准；</SPAN><SPAN lang=EN-US>2.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于普通的软件从业者来说，学习</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">比学习</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">要更容易一些；</SPAN><SPAN lang=EN-US>3.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以使用的工具更丰富一些。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>MOF</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">阵营</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来直接构建建模语言和模型转换语言在一些书中称为“重量级”方法，而使用</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来扩充</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">生成新的建模语言称为“轻量级”方法。由此可见，学习和使用</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一件比较耗时的事情，但是这并没有阻挡</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的脚步，他们认为</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">才是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的核心，才是纯粹的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义的四层模型，几乎将以往的模型概念一网打尽，在前人的基础上（</SPAN><SPAN lang=EN-US>M1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层和</SPAN><SPAN lang=EN-US>M2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层的模糊概念）又定义了</SPAN><SPAN lang=EN-US>M3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>M0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层。其中</SPAN><SPAN lang=EN-US>M2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层可以包容以往所有已知的建模语言规范，然后定义了一个唯一的</SPAN><SPAN lang=EN-US>M3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层，可以创建出所有这些建模语言，目前所有已知的模型技术中，唯有</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是拥有</SPAN><SPAN lang=EN-US>M3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层的，而且它是自定义的。这样</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">兼容并蓄了所有的建模技术，成为一支独大的元元模型工具。目前几乎所有的建模工具都号称</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">兼容的，因为做到这一点实在是太容易了，只要稍微修改一下自己的模型规范即可。可以这样认为，所有不愿意使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的建模者，在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出现后一定倒向了</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营。而且，新的模型语言和</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的创建和使用者，也大部分会倒向</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（使用</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于这些人来说，不如使用</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来得顺手和自如）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在制订</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之初很明智的让</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">脱离了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，这样增加了</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的生命力，与其让</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术与新的技术竞争，不如将</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分化为几个阵营之争。</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的缺点是学习困难，工具较少，而优点则是灵活自如。由于对</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">没有深入研究过，姑妄言之。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">可执行的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>UML</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">阵营</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个阵营的人一定不会介意我将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">称为第四代语言。在第三代语言（高级语言）瓜熟蒂落之时，就开始了第四代语言的争论，到底第四代是属于</SPAN><SPAN lang=EN-US>SQL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的描述性语言，还是类似于</SPAN><SPAN lang=EN-US>Agent</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">系统这样的智能系统，或者网格？神经系统？</SPAN><SPAN lang=EN-US>Web Service</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">？但是这个阵营的人会自豪的告诉你，第四代语言就属于可执行的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，其他的无论影响力还是问题域的覆盖性，统统不如。（可能我的语言有点偏激，大家不要砸砖。。。）</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个阵营里面的人有个很好听的名字，“模型程序员”。当</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">真正可以执行了，对于高级语言程序员的需求量就会像现在的汇编程序员一样稀少了。（写到这里，想起了前年和几个网友一起为</SPAN><SPAN lang=EN-US>MDACHINA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">论坛的《模型程序员》写稿的日子，时光荏苒啊，转眼都当爸爸了。）可执行的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">研究的热点，尤其是在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术提出之初，所有的</SPAN><SPAN lang=EN-US>MDAer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都满心欢喜的想象</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编译器的出现，可以将手头的模型直接转换为可执行程序。在</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">网站内部，就介绍了三本</SPAN><SPAN lang=EN-US><A href="http://www.omg.org/mda/reading-room.htm"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可执行</SPAN>UML</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的书籍。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当然，在可以预计的将来（</SPAN><SPAN lang=EN-US>2,3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年内？），我都想象不到可以有完全不产生高级语言代码的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编译器。也许在某个局部领域内可以实现，但是能够做到像高级语言编译器那样完整，在目前是根本不可能的。原因很简单，目前的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达能力有限，它不能完全承载程序所需要的信息。即使是</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩充了动作语义之后。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">那么，通过进一步的扩充</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有没有可能呢？当然是可能的！当初谁也不认为高级语言可以完全取代汇编，可是现在已经很少有人再用汇编了（特殊领域如驱动程序等除外）。但是，目前的一个困境就是，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">已经过于臃肿了，已经由于体积的庞大遭到很多人的抛弃，如果再进一步扩充</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，是否会更加引起众人的反感？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于这种困境，我建议将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分为两个部分：</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">前台和</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">后台。前台是在目前</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的基础上进行精简，使之更加易学和实用；而后台是为了定义</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编译器，可以加入更多语义方面的东西。这样，可执行</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营的人可以致力于定义</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">后台，使之能够完全承载目前高级语言所能表达的语义，从而使</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的执行成为可能。类似于</SPAN><SPAN lang=EN-US>java</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟机，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟机也是可能出现的，在这个虚拟机上面，用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">前台编写的模型可以自动运行，如果在前台中没有定义详细的细节，那么后台可以加上大量的默认值使其可以运行。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>MDD</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">阵营</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>MDD</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营严格说来不一定属于</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阵营，因为他们无视</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的诸多规范，而是自成一体。他们是典型的“拿来主义”者，有用的就拿来，没用的就扔掉。很多人号称</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的支持者，但是从来没有遵循过任何</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范。他们只是拿来了模型驱动的思想来武装自己的开发方法。不过他们也许更加清晰的认识到</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的精髓，毕竟他们还没有在冗长的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范中泡得发白。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从另一个方面来说，他们是更加纯粹的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">支持者，因为</SPAN><SPAN lang=EN-US><A href="http://www.omg.org/docs/omg/03-06-01.pdf">MDA Guide</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的开头就说：</SPAN><SPAN lang=EN-US>MDA is an approach to system development, which increases the power of models in that work. It is model-driven because it provides a means for using models to direct the course of understanding, design, construction, deployment, operation, maintenance and modification. MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一种方法，而不是仅仅是规范。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">小结</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">谨以此文，献给那些还在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">泥潭中挣扎的战友们，愿能抛砖引玉。很多地方都是我猜测的，不一定完全属实，如果需要在正规文献中引用，请参阅超链中的正规文献（我链接的很多也不是正规文献，汗！都是</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），或者参阅其他文档。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/23512.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-12-12 16:53 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/12/12/23512.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一篇关于模型编织的文章及其他</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/12/11/23384.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sun, 11 Dec 2005 13:43:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/12/11/23384.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/23384.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/12/11/23384.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/23384.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/23384.html</trackback:ping><description><![CDATA[<H2 style="MARGIN: 13pt 0cm; TEXT-ALIGN: center" align=center><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">一篇关于模型编织的文章及其他</SPAN></H2>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">标题：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1"><SPAN lang=EN-US>Model Transformation and Weaving in the AMMA Platform</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">地址：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>http://www.sciences.univ-nantes.fr/lina/atl/www/papers/CR_2005_GTTSE_transfo_weaving.pdf</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时间：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>2005</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阅读时间：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>2005.12.10</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">摘要：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Model transformation creates a set of target models from a set of source models. This operation is central in current MDE approaches. However, we highlight in this paper some of its limitations. Model weaving is another operation on models, which specifies typed links between model elements. Model weaving can thus be used to specify abstract model transformations assets of links between source and target metamodel types. Therefore, we propose to combine model transformation and model weaving in order to overcome some of current model transformation limitations. This paper presents how we experimented this with ATLAS Transformation Language (ATL) and AMW (ATLAS Model Weaver) on an example.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型转换从一组源模型创建出一组目标模型。这种操作是目前</SPAN><SPAN lang=EN-US>MDE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法的主流。然而，在本文中我们指出了它的一些局限。模型编织是另外一种模型操作的方法，它定义了模型元素之间的有类型的连接。因此模型编织能够被用于将抽象的模型转换定义为一组源和目标元模型类型的连接。因此，我们建议将模型转换和模型编织组合起来去克服一些当前的模型转换的局限。本文给出了一个在</SPAN><SPAN lang=EN-US>ATLAS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型转换语言和</SPAN><SPAN lang=EN-US>AMW</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>ATLAS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型编织器）上实践本方法</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的例子。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">大意：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本文分为六个大的部分：</SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">1 Introduction<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当前的模型驱动工程学（</SPAN><SPAN lang=EN-US>MDD</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）中，例如微软的软件工厂，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等，模型转换都是一个核心的技术。目前已经发展出很多模型转换的方法，但是模型转换的标准</SPAN><SPAN lang=EN-US>QVT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一直没有能够制订。模型编织是另外一种操作模型的方法，它通过建立模型元素之间的连接来编织模型。模型编织与模型转换存在一些不同之处。它克服了模型转换的三个主要局限。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">2 Transforming Relational Tuples into an XML Document<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本节介绍了一个应用场景，在一个图书馆信息系统中，将</SPAN><SPAN lang=EN-US>RDBMS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的数据转换到</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文档中。其各自的元模型如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=236 alt=image002.gif src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/一篇关于模型编织的文章及其他/image002.gif" width=431 border=0><BR>在这个场景中，使用</SPAN><SPAN lang=EN-US>ATL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言定义了一个模型转换程序，如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>module RDBMS2XML;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>create Target : XML from Source : RDBMS;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>rule Books {</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>from</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>db : RDBMS!BookRcd</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>to</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>xml : XML!Book (</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Title &lt;- db.Title, Author &lt;- db.Author,</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>ISBN &lt;- db.ISBN,</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>subjects &lt;- RDBMS!SubjectRcd.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>allInstances()-&gt;select (e | e.SID = db.SID)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>rule Subjects {</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>from</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>db : RDBMS!SubjectRcd (RDBMS!BookRCD.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>allInstances()-&gt;exists(e | e.SID = db.SID))</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>to</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>xml : XML!Subject (</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>SubjectID &lt;- db.SID,</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Descr &lt;- db.Name</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个程序定义了如何将</SPAN><SPAN lang=EN-US>RDBMS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的模型转换为</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">3 Limitations of Direct Transformations<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本节详细说明了上面模型转换方法的三个缺点：</SPAN><SPAN lang=EN-US>1)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方向性，只能从左到右转换，如果要反向转换则必须再写一个模型转换程序；</SPAN><SPAN lang=EN-US>2)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模式重用，对于稍微复杂的转换，要写大量雷同的代码，很多代码具有相同的模式，但是不能直接重用。</SPAN><SPAN lang=EN-US>3)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">变更的传播性，源和目标模型有小的改变则必须改变程序中的多处代码，很容易出错。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">4 Introducing Model Weaving<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本节以上面的实例作为例子介绍了模型编织的概念。下图很能说明模型编织的概念：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=222 alt=image004.gif src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/一篇关于模型编织的文章及其他/image004.gif" width=419 border=0><BR>从上图可以看出，上面的模型编织使用了三种类型的连接，分别是</SPAN><SPAN lang=EN-US>Equals</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>FK</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>Nested</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。其含义显而易见。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另外，文中给出了模型编织的元模型。因为模型编织的实例也是一个模型，因此它需要元模型予以规范。所以，文中给出了这个元模型关系图：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=178 alt=image006.gif src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/一篇关于模型编织的文章及其他/image006.gif" width=411 border=0><BR>文中还讨论了</SPAN><SPAN lang=EN-US>WMM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所应该具有的扩展性等特点，但是没有给出具体的元模型描述。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">5 Combining Weaving and Transformation<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本节简要介绍了如何将模型编织和模型转换组合起来来解决目前的模型转换中存在的问题。其主要思想是：首先建立一个模型编织的模型，然后利用这个模型来创建一个模型转换的程序，然后利用模型转换程序来具体进行模型转换的执行。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">通过模型编织的方法，克服了以前模型转换的三个缺点。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">6 Related Work<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">介绍一些相关工作，主要是模型转换的一些方法。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%">7 Conclusion<o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">结论也是老生常谈，再把上面的工作和优点都复述一遍，最后还说明了模型编织还可用于更加复杂的场景：在</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之间作桥接。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">感想：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<H3 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 16.0pt">模型编织</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Model Weaving</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个概念我是第一次见到。本文正好是一篇</SPAN><SPAN lang=EN-US>Model Weaving</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的入门文章，极大的满足了我的好奇心。</SPAN><SPAN lang=EN-US>Model Weaving</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的中文译名还不知道有没有正式确定，和</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">群里面的人讨论了一下，原来大家都翻译为模型编织，看来我还是误打误中了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">新生的事物总是缺点与优点同样突出的，模型转换方法发展好几年了，但是其最显著的缺点还是没有大的进步。本文指出了三个缺点：双向的模型转换方法很少而且难以实现；模型转换程序的代码难以重用；变更传播。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">很多研究者希望通过制订新的模型转换语言或者增加其语义来解决这些问题。但是本文的作者境界更高一点，他提出的模型编织是从一个更高的层次来解决问题，即提出一个模型转换程序生成器，来生成已有的模型转换程序，来降低模型转换程序的编写复杂性。所谓的模型编织即用一个二元连接来连接两个模型元素，并对这些连接制订类型和约束，最后根据这些连接类型来生成简单的模型转换代码程序块。这样一举解决了上面的三个问题。其思想含义等同于</SPAN><SPAN lang=EN-US>C</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编译器将</SPAN><SPAN lang=EN-US>C</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序编译为汇编代码。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作者使用的模型转换语言是</SPAN><SPAN lang=EN-US>ATL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，使用的模型编织器是</SPAN><SPAN lang=EN-US>AMW</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，他们统一集成在一个</SPAN><SPAN lang=EN-US>AMMA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台中，这个平台目前是一个开源的</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件。由于我还缺乏足够的资料，目前不能确定作者是否就是这个</SPAN><SPAN lang=EN-US>AMMA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台的开发者。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 16.0pt">模型转换语言</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型转换是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的热点所在，目前模型转换方法提出了很多，但是具体的模型转换语言我也只接触了三种（精力所限啊）：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>MTF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，模型转换框架，</SPAN><SPAN lang=EN-US>IBM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义的模型转换语言，</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件，规则型的模型转换语言，用来转换基于</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的模型插件定义的模型很方便；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>ATL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，本文介绍的模型转换语言，我还没有具体使用过，从本文的例子程序来看，也是规则型的模型转换语言。同</SPAN><SPAN lang=EN-US>MTF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相比，</SPAN><SPAN lang=EN-US>ATL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">详细定义了什么是源模型，怎样创建目标模型，这样可执行的程度更强，但是就只能单向执行，并且也相对复杂一些；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用来定义模型转换其实是水到渠成的一件事情，但是目前还不确定是否有可以运行的基于</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的模型转换语言。</SPAN><SPAN lang=EN-US>ATL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中就使用了部分的</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 16.0pt">问题解决了么</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当年在高中我学完经典力学时，认为所有问题都解决了，因为它是如此完美，上帝规定了所有的定律并创造了整个世界，然后用手轻轻一拨，世界便沿着宿命的轨迹运行到毁灭为止。后来才知道，有一种思想就叫宿命论。例如，我今晚选择写</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而不是去看网络小说，是因为我的某些脑细胞收到了某些脑电流刺激，而这些都是一些物理定律决定的，因此当世界开始的时候，就注定了我今晚要写</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US>Hoho</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">！后来才知道有什么概率问题，测不准原理等等上帝掷骰子的动作。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事实上，所有问题都没有解决的一天，直到这个问题不再成为一个问题，没有人再关注它是否解决为止。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型编织是否能够解决模型转换中存在的问题呢？当然不能，它只是在某个方向上作了很好的探索而已，事实上，它并没有触及到模型转换问题的本质所在。如我所言，模型编织事实上是一种模型转换程序产生器，无论多么优秀，但是模型转换程序本身不能解决的问题，它一样不能解决。充其量它减少了一部分复杂性，多了一些可用性而已。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型转换是为了解决模型之间的自动转换问题，或者说是为了自动生成软件模型；软件模型是为了解决高级语言代码的自动生成问题；高级语言是为了自动生成汇编语言。。。现在我们可以在模型转换上面再加一层了，可否就称之为模型编织层？记不得在哪篇文章中看见过：当某个问题无法解决时，我们就在软件中再加一层来折衷。我们到底是在写软件还是在做千层饼？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法多了一种，路多了一条，但是问题依然存在。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">题外话</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我的</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">又是两个多月没有更新了，这是有原因的（废话</SPAN><SPAN lang=EN-US>!</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不算）。前一个月我在努力写一篇论文，期间又去南京参加了一个会议。后一个月在家陪老婆生娃娃，努力喂奶换尿布做好爸爸，以至于累出胃病。不过成果是喜人的，特贴出小宝宝</SPAN><SPAN lang=EN-US>9</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">天照，以资鼓励：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p><IMG height=526 alt=image008.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/一篇关于模型编织的文章及其他/image008.jpg" width=552 border=0></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/23384.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-12-11 21:43 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/12/11/23384.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《中国学生写英语论文的常见错误总结》读书笔记</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/09/27/14166.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Tue, 27 Sep 2005 02:47:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/09/27/14166.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/14166.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/09/27/14166.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/14166.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/14166.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 《中国学生写英语论文的常见错误总结》读书笔记标题：The Most Common Habits from more than 200 English Papers written by Graduate Chinese Engineering Students原文链接如下：（不能保证是原始出处）http://me.sjtu.edu.cn/document/Most%20Common...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/09/27/14166.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/14166.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-09-27 10:47 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/09/27/14166.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Profile,Stereotype,TaggedValue与OCL漫谈</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/09/12/12718.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Mon, 12 Sep 2005 03:09:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/09/12/12718.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/12718.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/09/12/12718.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/12718.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/12718.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Profile,Stereotype,TaggedValue与OCL漫谈起因事情的起因是由于我需要在一篇文章中使用一个UML Profile for Design Pattern，就是在上一篇blog中提到的那个Profile。但是当我使用OCL来描述一些约束时，突然发现我不知道如何去取得PatternClass这个Stereotype中的TaggedValue的一个名字为role的值。并...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/09/12/12718.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/12718.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-09-12 11:09 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/09/12/12718.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《扩展UML用以在类图中显示设计模式》读书笔记</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/08/30/11595.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Tue, 30 Aug 2005 14:53:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/08/30/11595.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/11595.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/08/30/11595.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/11595.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/11595.html</trackback:ping><description><![CDATA[<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>1</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><FONT size=3>标题：</FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Extending UML To Visualize Design Patterns In Class Diagrams</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">原文链接如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><A href="http://www.utdallas.edu/~jdong/papers/seke03.pdf">http://www.utdallas.edu/~jdong/papers/seke03.pdf</A></SPAN></P>
<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>2</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><FONT size=3>时间：</FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>2003</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以后</SPAN></P>
<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>3</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><FONT size=3>阅读时间：</FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>2005.8.29</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>4</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">摘要：</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一个设计模式描述了对于某个设计问题的一种通用解决方案，并可以在多个项目中重复使用。软件设计师会在具体的项目中采用这些设计模式。设计模式通常使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">建模。但是，当某个设计模式被应用于或者结合了其他模式时，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不能保存与设计模式相关的信息。因此，设计者很难从软件系统的设计图中识别出设计模式。设计模式的好处被削弱了，因为设计者不能以他们自己使用的设计模式、设计决断和设计折衷的方式来进行交流。本文中，我们提出了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言家族的一个新成员的一组本质特征，它支持在面向对象的设计模式上工作。这个</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展允许在软件设计中进行设计模式的直接表达。我们也讨论了基于标准</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展机制的</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一些相关的方面。文中的一个示例展示了它如何被用于辅助基于模式的软件开发。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>5</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">大意：</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">除了摘要外，文章分为六个部分，分别是介绍（</SPAN><SPAN lang=EN-US>Introduce</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）、</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展机制（</SPAN><SPAN lang=EN-US>UML Extension Mechanisms</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）、被提出的扩展（</SPAN><SPAN lang=EN-US>The Proposed Extension</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）、示例学习（</SPAN><SPAN lang=EN-US>Case Study</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）、相关工作（</SPAN><SPAN lang=EN-US>Related Work</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）和结论（</SPAN><SPAN lang=EN-US>Conclusion</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm 13pt 70.9pt; TEXT-INDENT: -70.9pt; tab-stops: list 18.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT size=3>5.1</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><FONT size=3>Introduction</FONT></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>Introduction</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">部分介绍了为什么要对</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做基于设计模式的扩展。首先当然是论述了设计模式的重要性，然后指出了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于表达设计模式的不足之处，其中最重要的不足之处就是当有几种设计模式混杂在一起时会导致设计模式相关信息的丢失。这点很容易理解，当某一个类扮演了不同设计模式中的不同角色时，确实不能够只从类的名称上看出设计模式的相关信息。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm 13pt 70.9pt; TEXT-INDENT: -70.9pt; tab-stops: list 18.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT size=3>5.2</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><FONT size=3><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展机制</SPAN></FONT></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展机制这一部分简要的介绍了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的标准设计模式（</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），包括</SPAN><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（构造型），</SPAN><SPAN lang=EN-US>Tagged Value</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（标签值）和</SPAN><SPAN lang=EN-US>Constraint</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（约束）。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm 13pt 70.9pt; TEXT-INDENT: -70.9pt; tab-stops: list 18.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT size=3>5.3</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><FONT size=3>The Proposed Extension</FONT></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>The Proposed Extension</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这一部分是本文的重点所在，提出了</SPAN><SPAN lang=EN-US>UML Profile for Design Pattern</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。这个</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包括三个</SPAN><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和三个</SPAN><SPAN lang=EN-US>Tagged Value</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，以及一些约束，具体内容如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR style="mso-yfti-irow: 0">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 106.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=142>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Stereotype</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 70.15pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=94>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Applies To</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 249.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=333>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Definition</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 106.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=142>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&lt;&lt;PatternClass&gt;&gt;</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 70.15pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=94>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Class</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 249.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=333>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Indicate that this class is a part of a design pattern</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 106.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=142>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&lt;&lt;PatternAttribute&gt;&gt;</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 70.15pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=94>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Attribute</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 249.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=333>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Indicate that this attribute is a part of a design pattern</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3; mso-yfti-lastrow: yes">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 106.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=142>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&lt;&lt;PatternOperation&gt;&gt;</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 70.15pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=94>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Operation</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 249.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=333>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Operation Indicate that this operation is a part of a design pattern</SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>Tagged Values</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR style="HEIGHT: 7.9pt; mso-yfti-irow: 0">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 149.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 7.9pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=199 colSpan=2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Tagged Value</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 7.9pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=144 rowSpan=2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Applies to</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 168.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 7.9pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=225 rowSpan=2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P></TD></TR>
<TR style="HEIGHT: 7.85pt; mso-yfti-irow: 1">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 41.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 7.85pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=55>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Name</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 7.85pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>Value</SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 41.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=55>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>pattern</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;name[instance],role&gt;</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;&lt;PatternClass&gt;&gt;</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 168.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=225>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Indicate that the attached class plays the role of <I style="mso-bidi-font-style: normal">role</I> in the <I style="mso-bidi-font-style: normal">instance</I> of a<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>design pattern named <I style="mso-bidi-font-style: normal">name</I><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 41.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=55>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>pattern</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;name[instance],role&gt;</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;&lt;PatternAttribute&gt;&gt;</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 168.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=225>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Indicate that the attached attribute plays the role of <I style="mso-bidi-font-style: normal">role</I> in the <I style="mso-bidi-font-style: normal">instance</I> of a<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>design pattern named <I style="mso-bidi-font-style: normal">name</I></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 4; mso-yfti-lastrow: yes">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 41.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=55>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>pattern</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;name[instance],role&gt;</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 108pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=144>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;&lt;PatternOperation&gt;&gt;</SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 168.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=225>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Indicate that the attached operation plays the role of <I style="mso-bidi-font-style: normal">role</I> in the <I style="mso-bidi-font-style: normal">instance</I> of a<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>design pattern named <I style="mso-bidi-font-style: normal">name</I></SPAN></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简单的说，这个</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面增加了三个</SPAN><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，分别是</SPAN><SPAN lang=EN-US>PatternClass</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>PatternAttribute</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>PatternOperation</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，它们分别扩展了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的元模型元素</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Attribute</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>Operation</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，其含义分别代表了设计模式中的类、属性和操作等角色。另外对于每个</SPAN><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，还附加了一个标签值，标签值的形式是</SPAN><SPAN lang=EN-US>&lt;name[instance],role&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，其中</SPAN><SPAN lang=EN-US>name</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代表设计模式的名称、</SPAN><SPAN lang=EN-US>instance</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代表设计模式的实例标号（例如有两个</SPAN><SPAN lang=EN-US>Abstract Factory</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模式，则编号分别为</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）、</SPAN><SPAN lang=EN-US>role</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代表设计模式中的角色名称。最后还有两个用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">写成的约束。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于某一个模型元素（例如类、属性和操作）扮演了多个设计模式中的不同角色的问题，可以将多个标签值按次序写在</SPAN><SPAN lang=EN-US>Stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的后面，来显示这个元素的多重身份。例如</SPAN><SPAN lang=EN-US>&lt;&lt;PatternClass{&lt;DAO,DataAccessObject&gt;&lt;Abstract Factory[1],AbstractFactory&gt;}&gt;&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这是</SPAN><SPAN lang=EN-US>DAO</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个类的构造型，它显示了</SPAN><SPAN lang=EN-US>DAO</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个类属于两个设计模式，第一个是</SPAN><SPAN lang=EN-US>DAO</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个设计模式，其中的角色是</SPAN><SPAN lang=EN-US>DataAccessObject</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（数据访问对象）；第二个是抽象工厂设计模式，其角色是</SPAN><SPAN lang=EN-US>AbstractFactory</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<H3 style="MARGIN: 13pt 0cm 13pt 70.9pt; TEXT-INDENT: -70.9pt; tab-stops: list 18.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT size=3>5.4</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT size=3>示例学习</FONT></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这一部分展示了一个使用了</SPAN><SPAN lang=EN-US>UML Profile for Design Pattern</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的小例子，这个例子是一个“学生信息管理系统”，其中使用了两个抽象工厂模式，两个单件（</SPAN><SPAN lang=EN-US>Singleton</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）模式，一个</SPAN><SPAN lang=EN-US>DAO</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（数据访问对象）模式。其设计图如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（算了，设计图太大，还是到原文中去看吧。原文是</SPAN><SPAN lang=EN-US>pdf</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，看得比较清楚！）</SPAN></P>
<H3 style="MARGIN: 13pt 0cm 13pt 70.9pt; TEXT-INDENT: -70.9pt; tab-stops: list 18.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT size=3>5.5</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT size=3>相关工作和结论</FONT></SPAN></H3>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这两个部分当然是说本文的工作好，比起其他相关工作来有优点。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>6</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><FONT size=3>笔记：</FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">感受最深的是，这篇文章提出了一个很正式的</SPAN><SPAN lang=EN-US>UML Profile for Design Pattern</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，而且这个</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简单实用，比起其他连篇累牍的</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来，本文提出的解决方案确实有可行之处。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第二点是这篇文章的作者考虑到了多个</SPAN><SPAN lang=EN-US>Pattern</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在一起容易混淆角色的问题，并做出了完整的解决方案，使用了多个标签值来避免了信息的混乱和遗漏，这一点也加深了我对于标签值功能的印象。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第三点是这篇文章中的示例非常优秀，是一个很常见的例子，其主要思想是在数据库变更的情况下，如何保持原有代码不变动。其中用到了抽象工厂和</SPAN><SPAN lang=EN-US>DAO</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这两个非常成熟而优秀的设计模式，加深了读者对文章的理解和印象。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">总而言之，这是一篇非常值得借鉴的文章，它对于有以下读者都很有帮助：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l1 level1 lfo2"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">正在学习</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展机制的人；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l1 level1 lfo2"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">正在学习设计模式使用的人；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l1 level1 lfo2"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">正在研究</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的人；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l1 level1 lfo2"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">正在研究模型转换、模型重构、模型进化这一类问题的人；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这篇文章我觉得非常优秀，并不是它的理论多么高深（事实上几乎没有什么理论），也并不是它的工作量多么大（可以看出工作量很少），也并不是它的作者多么有名（反正我第一次看见这两个作者），而是它确实对某个有意义的问题做出了接近与正确的解答。正是因为看到了这篇文章，让我对自己刚刚写好的一篇文章进行大刀阔斧的修改，在文中完全使用这篇文章所提出的</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，如果有人看到了更好的</SPAN><SPAN lang=EN-US>UML Profile for Design Pattern</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，请通知我一声，谢谢！</SPAN></P>
<H2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><SPAN lang=EN-US style="mso-fareast-font-family: Arial; mso-bidi-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial size=3>7</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><FONT size=3>后记</FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我的博客又好久没有更新了，这与我刚刚过去的暑假有直接的联系，不是我懒惰，而是暑假太诱人，如果我还有暑假的话，我保证在下一个暑假一定会更新我的博客。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/11595.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-08-30 22:53 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/08/30/11595.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OMG的打字员不喜欢括号</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/07/09/7425.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sat, 09 Jul 2005 13:58:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/07/09/7425.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/7425.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/07/09/7425.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/7425.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/7425.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>7</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">月的长沙，真的可以热死骆驼。即使是周末，也完全没有任何玩乐的兴趣（</SPAN><SPAN lang=EN-US>or money</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">？）所以只有闷在机房苦苦的写</SPAN><SPAN lang=EN-US>paper</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。手上这个</SPAN><SPAN lang=EN-US>paper</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的初稿已经写了一个多月了，越写困难越多，终于昨晚不得不重新苦读</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Specification</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">了。结果不经意发现了两个小错误，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范文档竟然也如国内软件的程序员手册一样，喜欢犯掉括号的错误。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>omg</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范文档《</SPAN><SPAN lang=EN-US><A href="http://www.omg.org/docs/ptc/03-09-15.pdf">UML 2.0 Infrastructure Final Adopted Specifcation</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">》中，第</SPAN><SPAN lang=EN-US>183</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页掉了两个括号，第一个是在下面的</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式中：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>self.metaclassReference.importedElement-&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>select(c | c.oclIsKindOf(Classifier) and</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>(c.generalization.namespace = self or</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>(c.specialization.namespace = self) )-&gt;isEmpty()</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">很显然子表达式</SPAN><SPAN lang=EN-US>(c.generalization.namespace = self</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">掉了一个反括号“</SPAN><SPAN lang=EN-US>)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">”。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另外一个错误也是在一个</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式中：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>self.metamodelReference.importedPackage.elementImport.importedElement.allOwningPackages())-&gt;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>union(self.metaclassReference.importedElement.allOwningPackages() )-&gt;notEmpty()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这次掉了一个正括号“（”，位置是整个表达式的开头。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由此可见，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的打字员很不喜欢括号。嘿嘿！</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由于颇为无聊，则给</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">发了一封</SPAN><SPAN lang=EN-US>Email</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，结果</SPAN><SPAN lang=EN-US>163</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的邮件在</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">秒钟后就被退了回来，由此可见，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">很不喜欢网易！改用</SPAN><SPAN lang=EN-US>Gmail</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，则很轻松的发出去了。这说明，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>Google</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关系很好。但是上次一个同学说，用</SPAN><SPAN lang=EN-US>Gmail</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">给一些国内的邮箱发信，则会经常被退，看来无论如何，蛋糕是分不均的。为了保险起见，还是国内国外的邮箱各一个最为保险。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">说到邮箱，上次我的</SPAN><SPAN lang=EN-US>163</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邮箱被盗了，不知道哪位大虾干的，我好不容易才拿回来。希望大家不要再盗我的邮箱了，没什么意思，里面绝对没有</SPAN><SPAN lang=EN-US>sex</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关的内容，都是一些技术相关的联系邮件，于你无益，于我却损失颇大。况且，我不是研究网络安全的，也无意与你切磋相关技术，如果真的要显示自己是黑客高手，请去盗一些国内著名黑客的邮箱吧，那样会让你一举成名。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">酷暑炎炎，无心睡眠，研究</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，颇有心得，乃记之！</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/7425.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-07-09 21:58 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/07/09/7425.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转载：James Rumbaugh关于MDA技术的讲话</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/07/01/7016.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Fri, 01 Jul 2005 14:23:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/07/01/7016.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/7016.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/07/01/7016.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/7016.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/7016.html</trackback:ping><description><![CDATA[说明一点，首先我的blog几乎不转载文章，不过这篇文章实在是太帅了，不转载我都不忍心。上天啊，为什么让我今天才看到这篇文章呢？<BR>转载地址：<A href="http://www.csdn.net/news/newstopic/18/18331.shtml">http://www.csdn.net/news/newstopic/18/18331.shtml</A><BR>James Rumbaugh介绍：James Rumbaugh 大师是享誉全球的软件开发方法学家。1994 年加入 Rational 软件公司之前，James在纽约斯卡奈塔第的通用电气研发中心工作了25年多，开发了 DSM 面向对象的程序设计语言、状态控制树模型、OMT 对象建模概念以及对象建模工具(Object Modeling Tool)图形编辑器。他与 Grady Booch 和 Ivar Jacobson 一道，开发了统一建模语言(Unified Modeling Language，UML)，对象管理组织(Object Management Group，OMG)1997 年将 UML 采纳为业界标准建模语言。James提出了许多有关 UML 的概念，一直是引导 UML 未来开发的领袖。2003 年 IBM 收购了 Rational 公司之后，James一直致力于推动 IBM 建模工具的开发。 <BR>（这一段介绍转载自<A href="http://www.cvicse.com/news/2004news/james/">http://www.cvicse.com/news/2004news/james/</A>）<BR><BR>讲话原文：<BR><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">早上好，你们好吗？很高兴五年之后又来到中国，（五年前我来过中国）我看到在中国发生了很大的变化。我是从上海驱车赶往南京，一路上看到每隔几百米就有一个新的建筑拔地而起，我对中国发展的速度感到非常惊讶，希望在软件行业能够构建出同样辉煌的建筑。今天我要告诉大家一些有关软件构建的秘密。<BR><BR></SPAN><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">今天我会告诉大家怎么样更加方便、容易地来开发软件。为什么大家都觉得软件开发非常困难呢？我觉得主要原因是业务领域跟计算机领域之间的概念有很大的差别。一般来说业务是用自然的语言来表述，但是软件有可能是用一些非常低级的计算机语言来表述的。构建一个软件需要写很多的代码，要写很多的控制逻辑，有很多复杂的东西在里面。作为软件开发者我们的任务就是要在业务跟软件之间构建起一座桥梁。我们有四种方法使得软件开发变得更加简便。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第一种方法就是尽量向业务领域描述靠拢，尽量用高级语言来直接描述业务领域的概念。大家看到右面这张图是用高级语言、抽象语言来描述的业务的概念，从业务模型到最终软件的实现有可能还要构建一些中间的层次来搭建他们之间的桥梁。为了控制细节上的复杂度，就要很好地来构建我们软件的架构，控制好构件之间的协作关系。为了减少我们书写的代码量，我们可能会使用一些自动化的工具来帮助我们自动生成代码。大家都习惯于最简单的软件开发方式就是坐下来直接写代码，这看上去好像是一种最简单的方式，但实际上最后会给我们带来更大的麻烦。如果开发人员只是写代码而没有设计的话，很有可能他所构建的这个系统的架构就不是那么完善，同时代码之间没有很好地协调。不同的开发小组写的代码可能功能上会有所重叠或者是相互冲突，不同的开发小组就会使用不同的、不一致的格式进行交互。这是一种非常不好的协作模式，因为开发团队之间会相互干扰，而破坏对方的一些工作成果。而且如果是开发人员去写代码的话，就意味着他们有更多的工作要去完成。在最糟糕的情况下大家看到这样的系统有可能是非常脆弱的，任何改变都可能会破坏整个结构。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们向大家推荐的方法就是称之为模型驱动架构这种新的方</SPAN><SPAN lang=EN-US>(<SPAN style="COLOR: blue">MDAModel Driven Architecture)</SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。在这种方法里我们使用一个高级的模型来描述一些业务领域的概念，基于这种高级的模型再来生成基于某种特定运行平台的代码。在这个过程中我们会使用一些自动化的工具，基于一些标准来生成我们的代码。</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法是由对象管理组</SPAN><SPAN lang=EN-US>OMG (Object Management Group) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提出来的，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是国际化的标准化的组织。我们在开发的时候，起点是比较高级的业务领域的模型，这个模型我们称之为平台无关模型，也就是</SPAN><SPAN lang=EN-US>PIM (Platform Independent Platform)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。在这个平台无关的模型里我们着重关注的是业务的逻辑。涉及到具体平台相关时我们会使用一种与实现相关的</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，这种</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">描述了特定平台的实现细节。基于平台无关的模型以及特定平台的</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">就可以自动生成基于某种特定运行平台可运行的系统，称之为平台相关模型</SPAN><SPAN lang=EN-US>PSM (Platform Specific Model)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。从同一种平台无关模型出发，你可以针对多个不同的运行平台来生成多个不同的</SPAN><SPAN lang=EN-US>PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，最后基于</SPAN><SPAN lang=EN-US>PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">你还可以生成具体的代码。在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里我们需要三样东西，首先我们需要来描述问题的模型，在这里可以使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者是使用新的领域描述语言</SPAN><SPAN lang=EN-US>DSL (Domain Specific Language) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述业务领域方面的模型；第二个需要利用架构框架来描述具体的实现，架构框架可以针对某种具体实现作出一些假设，从而基于这些假设来减少我们在建模阶段所涉及的细节，最后通过一些自动化的工具来生成实际可运行的模型或者是模型的特定翻译工具等等。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接下来我要介绍的是问题领域相关的模型。一种描述问题领域模型的方式就是使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，大家都知道</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最初是由</SPAN><SPAN lang=EN-US style="COLOR: blue">Grady Booch</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="COLOR: blue">Ivar Jacobson</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和我共同</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">创建的，后来</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里的其他成员也陆续对这个语言进行了扩展。现</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">已经成为对象领域被全世界开发人员广为使用的一种语言。跟编程语言相比</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一种更加高级的描述语言，在这种语言里我们减少了很多不必要的、细节的描述。理论上讲</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以应用于很多领域，我们可以对</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">加以改造，利用一种称之为</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的机制可以使</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用于某些特定的领域。</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是在</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的基础上针对某些特定的领域进行一些改造，使得它能够支持这些业务领域里特定的业务概念。但即便是我们使用</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这种特殊的机制，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本身还是一种非常通用的语言，里面还是包含了很多重复性的细节。另外一种方式就是利用称之为领域描述语言的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言来描述问题领域的这些概念。</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一种特殊的语言，有它自己的语法和语意，它是针对某一种业务领域而设计的。</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是利用一些比较高级的概念来描述问题领域的概念，这样它可以减少业务领域跟具体实现之间的差距。</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里也可以包括一些预先置好的数据与模式，基于</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的模型可以减少一些重复性的控制逻辑的描述，同时生成更加底层、详细的代码。这里我们来看一些现有的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的例子。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">首先大家想不到的是在</SPAN><SPAN lang=EN-US>30</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年以前我们就有这样一种</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言，就</SPAN><SPAN lang=EN-US style="COLOR: blue">yacc</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，在这个</SPAN><SPAN lang=EN-US style="COLOR: blue">yacc</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里用巴柯斯范式</SPAN><SPAN lang=EN-US>BNF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来构建编译器。</SPAN><SPAN lang=EN-US style="COLOR: blue">yacc</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编译器就可以利用你所描述的</SPAN><SPAN lang=EN-US style="COLOR: blue">BNF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来构建复杂的语法编译工具，从而减少手工开发这种编译工具的难度。另外一种大家想象不到的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是大家经常用的</SPAN><SPAN lang=EN-US>GUI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编程工具，来帮助你搭建用户界面。在这种工具里就可以在屏幕上画上你想要的表格、图表或者是控件等等。大家看到在屏幕上画了这些控件，在内部代表着上千行的代码。但是开发人员不用去描述这些细节的控制逻辑，工具会帮你做到所有的这一切，这样大大简化了开发人员的工作量。另外一种</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">大家可能都想像不到，就是我们日常在使用的桌面编辑工具，像</SPAN><SPAN lang=EN-US>FrameMaker </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者是</SPAN><SPAN lang=EN-US>Word</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具。作者可以很容易地用这个工具来写下他们所编辑的书或者是插入一些他们想要的控制逻辑，像图片等等。另外一种就是大家知道的</SPAN><SPAN lang=EN-US>MIDI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，用于在乐器跟电脑之间的一种描述语言，它可以让电脑也能够产生音乐。音乐家利用</SPAN><SPAN lang=EN-US>MIDI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这种语言不用编程就可以创造出音乐。另外一个例子就是数学上的一些应用工具，利用这些工具用户可以直接用数学表达式、数学公式来描述一些复杂的概念。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这里我再给大家介绍另外一种特殊的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，就是以前大家广为使用的</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是国际电信联盟</SPAN><SPAN lang=EN-US>ITU</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所通过的一种标准，很多电信制造商都在利用这种标准来描述他们的电信设备，如交换机。很多知名的电信企业如摩托罗拉、爱立信等都在使用</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述他们的应用。这种语言提供了复杂的描述手段，使得这些企业能够利用它来描述电信上的一些复杂协议。我跟这些企业的开发人员都有过一些合作，我发现他们在使用一些工具时都存在着一些困难。因为随着时代的进步</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">逐渐退出了主要的潮流，它并没有包括一些最新的像</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具里的一些特性。最近对象管理组</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">刚刚完成一项项目，就是把</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">升级到</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。来自于摩托罗拉、爱立信的开发人员成为这个项目组的成员之一，在这个项目里我们把</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一些概念也加入到</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面。所以当</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出来之后现在可以把</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做成</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一种</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。这意味着传统的</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的用户也可以利用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具来继续你的软件开发，同时也可以利用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里其他的一些特性。这也是一个很好的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言的发展历程，在这个历程中大家看到如果一种概念型的领域描述语言比较有用的话，其实还会继续延伸它的生命力，比如像</SPAN><SPAN lang=EN-US>SDL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">被加入到</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里去。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有关这个领域描述语言有几种不同的类型，有一种形式称之为描述式</SPAN> <SPAN lang=EN-US>(Declarative</SPAN></FONT></FONT><FONT size=3><FONT face=Arial><SPAN lang=EN-US>) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的。在这种描述式的语言里只需要描述我们需要做什么，但是并不需要描述详细的控制逻辑。这就像我们用数学公式来描述复杂的数学问题一样，并没有说明我们应该如何来解决这个问题。这种形式的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">被广为使用，因为简化了开发的工作量，他们并不需要描述详细的控制逻辑。如果计算机能够自动地生成这种解决方案的话，这其实是一个非常有用的方式。但是实际的情况并不是如此，所以会有另外一种形式的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言称之为命令式</SPAN><SPAN lang=EN-US>(Imperative) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的，需要写出一行行的指令来告诉如何解决这个问题。这种形式的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">详细描述了具体的控制逻辑，当然也给开发人员带来了难度，因为它更难以使用。所以我们想出一种折中的方式把这两种形式结合起来。在这种方式里我们就用一些高级的描述性的方式来描述这些问题领域的概念。在开发的后期我们可以使用低级的命令行的方式来描述这些细化的控制逻辑。这种方式实际上是结合了前面两种描述方式的优点。现在又有了一个非常流行的概念叫做面向</SPAN><SPAN lang=EN-US>Aspect</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的编程</SPAN><SPAN lang=EN-US> (AOP – Aspect Oriented Programming) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，在这种方法里我们是把不同的需要解决的问题划分成不同功能的</SPAN><SPAN lang=EN-US>Aspect</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，一些有关</SPAN><SPAN lang=EN-US>Aspect</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的例子就包括如何控制安全性、如何永久地保存数据、如何提供一种并发的处理机制、以及如何记录一些日常信息等等。所以每一种</SPAN><SPAN lang=EN-US>Aspect</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实际上可以帮助我们来解决某一个特定领域的问题，但是这种解决方案是横跨整个系统的。在这种方式里我们需要有一个翻译软件把这些</SPAN><SPAN lang=EN-US>Aspect</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转化成具体的代码。解释软件应该知道</SPAN><SPAN lang=EN-US>Aspect</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之间的差异和相互的交互，应该能够补充一些必要的代码把他们整合起来。实际上从本质上讲</SPAN><SPAN lang=EN-US>AOP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法跟刚才讲的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言是非常接近的，在每一种方法里都有一种高级的描述方法来描述问题领域的这些概念，同时都需要有一种翻译软件把这个模型翻译成最终的实现。现有的这些</SPAN><SPAN lang=EN-US>AOP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言并不是太好，有些并没有我们想像中工作得那么好。翻译工具不能很好地工作，开发人员还是需要去描述一些他们之间实现的细节。我认为在</SPAN><SPAN lang=EN-US>AOP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这种技术真正非常流行之前，我预期到</SPAN><SPAN lang=EN-US>AOP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的下一个版本一定要增强转换</SPAN><SPAN lang=EN-US> (transform) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的功能，这样才能能使得它更加流行。我认为这种</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言可以帮助我们来描述这种</SPAN><SPAN lang=EN-US>AOP </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的自动生成、自动转换功能。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&nbsp; 接下来我们来看一下架构框架。架构包括好几样东西，首先在构建架构时要做的是将系统分解成为一些子系统，这些子系统本身应该有完整的功能，同时应该能够相互交互。子系统之间功能上不应该有重叠，在这种架构里我们需要描述子系统之间交互的拓扑逻辑，常见的拓扑逻辑包括像流水线、星形结构等等。架构的另外一个方面就是要描述子系统之间的交互规则以及他们所交换的数据格式。另外架构设计师也需要描述有关资源管理的规则，这样使得不同的开发人员能够更加有效地来使用这些资源，这里提到的资源就包括像内存、系统进程等等这些概念。所谓好的架构跟差的架构之间的差别就在于一个好的架构它能够更好地适应系统将来的变化，注意这个变化是不会自动发生的，是应该由架构设计师为将来的变化做好准备。在一些好的架构里会使用“钩子（</SPAN><SPAN lang=EN-US>Hook</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）”这种机制，它可以使得我们不用修改这个系统就可以增加一些新的功能。我们经常看到很多项目延期的情况，原因就是项目里的很多测试工作被忽略掉了。举一个类比，大家想想现在汽车里的发动机，发动机里有很多传感器，这样汽车上的电脑可以随时感知发动机里的工作状态。大家想象一下如果先把发动机造出来再把传感器放进去，这实际上是行不通的，在设计发动机时就应该考虑要把传感器放进去。在做开发时架构设计师也要把测试这个概念加入到开发过程中去，使得测试成为我们开发过程的一部分。所以我们应该在早期设计架构的时候就应该考虑到测试，这样能够有效地提高软件的质量。实际上大家都知道架构是很难去搭建的，我们想方设法使得架构这种工作对开发人员来说变得更加简单。所以我们是把其他开发人员在开发过程中得到的一些好的架构经验总结出来，称之为架构框架。所谓的架构框架实际上是一种可重用的架构模式，这种模式是从好的架构模式里总结出来，这些架构模式可以进一步地被其他人所重用。<BR></SPAN></FONT></FONT><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><BR></P></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构框架包括好几样东西，首先我指的是执行环境的框架，这里包括很多小的元件，这些元件之间是相互继承的。这些小的控制单元对用户来讲并没有提供它的价值，它所关注的只是这些小的控制单元内部的控制逻辑。它也包括预先定义好的系统之间交互的接口、数据格式等等。所以我们可以预先构建好一个系统，逐渐地往里面增加它的功能。实际上我们很难把所有的东西都组合在一起，一下子把它构成一个可运行的系统。如果你试图把所有的东西一下子都集成起来的话，这实际上是非常困难的。一种比较简单的方法就是你从一个小系统开始，在开发的过程中逐渐往这个系统里增加功能，逐渐地把这个系统建立起来。基于这种开发理念，我们在设计架构框架的时候就会预留好一些扩展点，通过这些扩展点可以增加更多的功能，这些功能有可能体现为一些插件。在构造系统时就是把不同的插件插到不同的系统上去，好的架构框架应该也包括一些可重用的构件。开发人员应该利用现有的构件来开发系统，而不需要写代码。在构建一些复杂系统时，开发人员有可能也需要自己去开发一些构件，但是并不需要所有的构件都从头做起。一切好的架构框架实际上都应该包括一些好的例子，这样对我们可以有更大的帮助。实际上大家都有这种经验，当你采用一种新技术时很难判断怎么样把各种部件集成在一起，但是如果这时有一些很好的例子的话，我们的工作就会变得简单。这里大家看到的一些有关架构框架的例子就包括我们经常谈到的</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者是</SPAN><SPAN lang=EN-US>J2EE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用架构框架可以给我们带来很多好处，它可以使我们非常容易地利用</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述一些现有的概念，也可以帮助我们来保证系统的一致性。如果系统是由很多小组来开发的话，这种框架可以在不同小组搭建的系统之间保持高度的一致性。另外它也可以保证基于同一种架构框架的不同开发应用也保持高度的一致性。另外它使得用户的界面所使用的数据模式、用户的体验等等在不同的应用之间也保持高度的一致性。架构框架也可以很好地帮助增量式的开发，可以从一个小的系统开始，基于这种框架来逐步增加它的功能。另外架构框架也可以减少我们开发设计的工作量，使得不同的开发人员在设计的时候减少他们的分歧。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们有很多种方法来帮助我们描述一个架构框架，第一种方式是可以用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型来描述架构框架，可以描述结构模型、接口模型、描述模式等等。基于那种框架我们可以描述</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言的语法和语意。每一种架构框架都会包含一些具体的代码，象</SPAN><SPAN lang=EN-US>C++</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者是</SPAN><SPAN lang=EN-US>Java</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等等。每一个框架也应该包含一些文字描述来告诉使用者如何来使用这个框架。总而言之架构框架的基本思想是要从专家手里把一些好的经验总结出来，使得所有人都能够共享这些好的经验。一个类似的例子就是模式</SPAN><SPAN lang=EN-US> (Pattern) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，模式已经是十年前的一个概念了。模式可以帮助我们来构建架构和解决一些具体的技术问题。什么是模式呢？模式是针对常见问题提供的解决方案。很多模式都有不同的参数，这些参数使得模式可以应用于不同的领域。所谓的模式有很多种级别，有些是比较低级的，象通常我们讲的设计模式，也有一些是帮助我们来构建模型的，也有一些是帮助我们来搭建系统架构的。跟我们刚才提到的架构框架一样，每一个模式它都应该有这样几部分，包括架构、结构、内部的交互规则以及一些使用指南等等。另外一种共享经验的方式就是来构建可重用的构件，构件是为一种特定的架构所设计的，在这个架构下不同的构件可以很好地相互合作。<BR></SPAN></FONT></FONT><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><BR></P></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接下来我再给大家介绍的是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术中有关自动化工具的部分。我们在做</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开发时需要的是一个建模工具，这个建模工具可以帮助我们来描述模型以及各种模式。如果你开发的是一个小系统，只有两三个人的小项目，就不需要建模工具。但是即便是简单的问题也有必要来使用工具，例如你会使用计算器来把数据加在一起，这样使你的工作更加简便。对于一些大的项目、十几个人的项目当然需要一个建模工具来帮助你们团队协作、帮助你们来记录你们设计的结果。假如没有工具来协调大家工作的话，在建模过程中你们的工作有可能会相互重叠、相互冲突，有些信息可能会丢失。工具同时也可以帮助我们来找出你设计中的一些错误或者是瓶颈之所在，帮助我们避免一些问题。一个好的自动化工具也可以根据你所指定的特定架构和平台来生成可运行的代码。自动化工具在生成代码时也会生成一些追踪信息，就是从模型到代码之间的关联关系也会被记录下来。对于一些大的项目而言，有可能你们会使用很多种不同的工具，这些工具有可能带来的困难是他们之间很难进行信息的交流。在这种情况下我们需要有一个公共的存储库来存放和管理所有的这些工具所产生的数据。这种公共的存储库应该可以使开发人员自由地修改数据，而并不影响其他人的结果。用于构建这种存储库的技术就包括</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Meta-Object Facility</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">元对象设施），另外一个是</SPAN><SPAN lang=EN-US>XML (eXtended Markup Language) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用于</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开发的另外一种工具主要是翻译工具，可以帮助我们把模型自动地翻译成为代码。一个好的工具可以基于某种特定的平台帮助我们生成代码。另外一种翻译工具就是一些代码优化工具。一个例子是，大家可以把这种优化想像成为它可以把一个简单的代码映射成为复杂的代码，从而提高运行效率。另外的转化工具包括重新排版、组合这些代码等等。实际上一个好的转化工具是很难得到的，现在我们有很多种不同的变换工具，现在对象管理</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">正在进行的一个项目称之为</SPAN><SPAN lang=EN-US>QVT (Query-View-Transformation) </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">项目，就是查询、察看和变换，这个项目的主要目的是为变换工具制定一个标准。这个项目预定是在明年的第一季度结束，一旦这个标准出台的话，它就可以使得不同的变换工具之间的协作变得更加简单。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&nbsp; 对于这种变换工具我们到底有哪些要求呢？首先这种变换工具一定要理解源和目标语言的语法，同时在这种工具在生成代码时，不要指望它生成的是最好的代码（可能是比较好的代码），因为通过这种工具已经减少了我们很大的工作量。实际上在这种变换工具上已经有很多年经验的积累，比如大家经常用到的编译器，我们希望把编译器上好的经验吸收过来。一方面需要构建自动化的变换工具来帮助我们转换代码，但是同时也要注意到我们现有的项目有很多历史代码。我们希望这种新的</SPAN><SPAN lang=EN-US>QVT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标准能够接受插件，以插件的方式来支持现有的这些代码。对于这个变换工具的另外一个要求是要使得它能够维护代码跟模型之间的关联，因为每当你对模型作出一个小的修改时，我们是希望这个工具能够相应地生成变化的代码，而不是每当你修改一部分模型之后这个工具需要把整个模型重新生成一遍，这是非常费时的。为了满足这种要求，变换工具需要保持模型跟代码之间的关联关系。对于这种变换实际上我们有几种不同的方式。第一种就是部分的转换，在这种方式里我们是把模型转换为代码，但是在这种转换里很多实现的细节是被忽略掉的。比如说现在大家正使用的很多</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具实现的就是这种转换，这种转换只是帮你生成数据结构或者是一些简单的代码框架。所以这种变换方式生成代码非常快，但是开发人员或者是编程人员需要做更多的工作来增加细节的描述。当然在这种变化里存在<U>着</U>风险：如果编程人员修改代码的话，有可能会破坏掉代码跟模型之间的关联。我们称之为双向变换的技术实际上是可能的，只要我们在这种变换工具里，在生成的代码里保持这种代码跟模型之间的关联关系就可以了。所以每当开发人员修改模型的话，我们就知道相应的哪一块代码需要做相应的修改了。但是这种逆向的变换往往是比较模糊的，从代码到模型我们往往不知道怎么样根据代码生成一个什么样的模型。主要的原因是因为代码比模型包含的信息更少，但是这种部分的变换技术其实是比较切实可行的技术，因为我们可以快速地利用它来建立我们的模型，并且生成我们的代码。但是从长远的角度来看这有可能并不是一个很好的解决方案。</SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另外一种取而代之的方法是完全生成，在这种技术里我们只有一种单向变换，就是从模型直接变换到代码，而且是百分之百地生成代码。在这种方法里开发人员是不会去修改生成的代码。但是这也对</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言提出要求，</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应该有能力来描述足够的细节。编译器就是一种完全生成的很好例子。大家都有这种经验，只会用编译器生成代码，但是从来不会去修改编译器所生成的汇编代码或者是信息代码。当我在很多年以前开发工作时这并不是一个事实，那个年代人们对编译器还不是非常信任，开发人员经常去检查编译器所生成的代码。现在编译器已经发展得足够成熟、足够好了，所以大家都非常信任这种变换。现在大家用的另外一种完全生成的例子包括格式的转换，比方现在有些工具可以帮助我们从</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型生成</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">格式。完全生成这种技术有可能适用于那些我们能够掌控所有细节的场合下使用。尽管现在这种完全生成的技术不是非常成熟，但是我预期在将来这种技术应该是越来越可用的。<BR></SPAN></FONT></FONT><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><BR></P></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第三种方式其实是把前面两种方式都结合在一起，就是把代码嵌入到模型中去。在这种方法里开发人员会把代码的片段插入到模型中去。在这种模型里如果</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的描述能力不够的话，开发人员就会用编程语言来描述这些细节。当变换工具生成代码时就会把开发人员插入的代码嵌入到最后生成的代码中去。所以如果开发人员想修改最终生成的代码的话会修改这个模型中插入的代码片段，重新利用这个模型来生成代码。这种方式有可能更象我们谈到的部分生成的例子，因为在这种技术里开发人员还是需要来写一些编程代码。但是他们还是有不同的，因为在这种技术里我们是把模型跟代码存放在同一个文件里。与其他的技术相比这种方式避免了我们丢失了模型跟代码之间一致性的危险。因为这个变换工具知道插入的代码在模型的什么地方，所以它可以很好地在模型跟生成的代码之间搭建这个映射。实际上这是一种非常灵活的技术，这种技术在几十年以前，在刚才提到的编译器的生成里面就已经用到这种技术了。这是一种非常灵活的工作方式，但是它要求开发人员同时在两个不同的层次进行工作，他既应该在高层次模型这个级别工作，同时也需要开发人员在低层次代码这一级别进行开发工作。但是在当前这个情况下，在我们有更好的完全生成的解决方案之前，这有可能是一种比较实际的技术。最后是一种更加先进的变换技术，在这种变换技术里我们为这种变换本身搭建起一个变换的模型。在这种技术里面，我们会针对这种变换来建立起一个模型，并且利用这个模型把原模型跟目标代码联系起来。利用这种开发技术进行开发的话，就意味着我们通常所讲的设计就是要去构建出这样一个变换。一旦我们搭建起这样一个变换模型就可以把这种变换应用到很多源模型上去。比如说我们可以应用这种技术来构建一些模式，利用这个模式应用到很多领域上去。这是一种非常强大的技术，但是我并不认为这是每一个开发人员都适用的一种技术。这种技术需要一些特定的技能以及相关的知识。但我还是认为这种技术可以给大家带来益处。谁可以用这种技术呢？是一些在开发团队里专门负责构建这个模式或者是构建架构框架的人，有一部分人可以用这种技术来构建出比较好的模式或者是架构框架，使得这种好的经验可以使更多的开发人员受益。</SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face=Arial><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">很多对于建模的批评就集中在模型是不可以运行的，我并不认为这是一种很好、很正确的想法。并不是说你看到一个模型就可以去执行它，实际上你可以利用一些自动化的工具来执行这个模型。早期的模型应该是不完整的，所以你不能期望它是可运行的。因为这个模型是不完整的，它里面有可能缺少一些必要的数据或者是一些未知的决策，这些都会阻碍这个模型成为可运行的模型。在某些开发模型里我们并不在意这种可运行，因为有些架构设计师他只关注于这种模式，但是并不在意具体的数据结构。这里可以采用的一种技术就是尽早地对架构进行一些测试，有可能还有很多细节不清楚，但是我们还是有办法对架构进行测试的，在</SPAN><SPAN lang=EN-US>IBM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">内部我们正在开发这种技术。也有人建议把</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">变成一种可运行的语言，但是我认为这并不是一个很好的主意。基本的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实际上是不可运行的，因为</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一个作用非常广泛的语言。</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在设计时就被设计成用来支持很多种不同的运行平台、很多种不同的编程语言，所以如果想把</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">变成可运行的跟你的想法之间就有一定的差距。另外</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本身作为一种建模语言，在其内部缺少了一些运行方面的语意，比如说你是不是需要多任务，还是外部的数据交换的格式等等。怎么样使得</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">变得可运行呢？你可以针对某一个特定的运行平台来制定一个特定的</SPAN><SPAN lang=EN-US>UML Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。比如说有一个现实的例子就是</SPAN><SPAN lang=EN-US style="COLOR: blue">RealTime Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，这个</SPAN><SPAN lang=EN-US>Profile</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使得</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以在实时系统设计这个领域变得可运行。但是大家注意</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本身还是一个通用的描述语言，</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可能是在很多情况下表述能力都要更强一些。我的想法是可以把</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最终实现的过渡语言。我们可以把</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所描述的语言模型转换成为用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">描述的一个中间产品。然后可以用工具把这种中间化的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型进一步转换成特定平台上可以运行的代码。这就等于是构建了从不同的</SPAN><SPAN lang=EN-US>DSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型到最终可运行平台的转换跟变换。<BR><BR></SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P><FONT face=Arial><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">刚才介绍了很多</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">的概念，下面做一下总结。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">还是一种非常早期的技术，我预计要再过四到五年才可以看到</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">技术被广泛地接受和采用。现在很多团队还只是把</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">在一些小的试点项目里应用，现在也有很多有关</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">技术的片断，但是这些片断其实并没有在一起很好地协作。我建议大家如果有兴趣的话还是要尽早地去尝试这种技术，这样可以更好、更早地来体会</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">给你带来的好处。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">DSL</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">这种语言还很少用到，但是会有更多的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">DSL</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">语言出现。举个例子，微软最近也宣布支持</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">DSL</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">，说明大家跟</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">IBM</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">都有同样的想法。从这里大家可以看到越来越多的企业在支持这些新的想法和概念。现在我们也有一些非常通用的框架存在，比如说刚才介绍的一些常用的像</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">.NET</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">、</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">J2EE</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">等。一些业界的标准化组织也在逐步地开发特定领域里的框架模型。比如说</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">OMG</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">里有一个项目正在开发针对医疗领域的框架模型，利用这种框架模型使得不同的医疗设备、诊断仪器之间可以很好地协作。现在也有一些团体在另外一些框架模型上工作，比如说针对金融行业、运输行业的。为了更好地推广应用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">技术我们也需要有一个好的变换技术，当然这个变换技术现在还处于一个比较早期的阶段。可以预见的是明年</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">QVT</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">技术可以成为现实，这就是一个很好的开端。但是在我们广泛接受这种变换技术之前我想还是需要一段时间来适应、应用这种技术，一个更新版本之后这种技术才能得到更为广泛的应用。我们也有很多经验可以来自于现有的编译器技术，可以把这些经验加到变换技术里去。现在看起来</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">MDA</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 12.0pt; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">技术还是一个非常新的技术，但是可以预见到它在将来的几年里会对整个软件开发行业产生非常重大的影响。谢谢大家!</SPAN></FONT> <img src ="http://www.blogjava.net/wxb_nudt/aggbug/7016.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-07-01 22:23 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/07/01/7016.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序员眼中的UML(4)--类图释疑之一，Attribute和Property之区别</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/06/20/6409.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Mon, 20 Jun 2005 14:52:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/06/20/6409.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/6409.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/06/20/6409.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/6409.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/6409.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 程序员眼中的UML(4)--类图释疑之一，Attribute和Property之区别上一篇中提出了很多问题，其中最令人费解的可能就是Attribute和Property之区别了吧。我在网络上寻找良久也没有发现好的解释，反而发现了很多混乱的解释和用法。因此，依靠OMG网站上的UML规范以及自己的理解，整理出了这篇文章。UML中的Attribute和Property之区别在很多人的脑海...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/06/20/6409.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/6409.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-06-20 22:52 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/06/20/6409.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序员眼中的UML(3)--类图，就是比你高一点</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/06/17/6317.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Fri, 17 Jun 2005 14:26:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/06/17/6317.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/6317.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/06/17/6317.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/6317.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/6317.html</trackback:ping><description><![CDATA[<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序员眼中的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">UML(3)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H1>
<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 240%">--</SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图，就是比你高一点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 240%"><o:p></o:p></SPAN></H1>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的成功</SPAN><SPAN lang=EN-US>80</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％是因为类图，提到</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候有</SPAN><SPAN lang=EN-US>90</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％的人想到了类图，应用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候</SPAN><SPAN lang=EN-US>100</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％应用了类图。如果类图和源代码走到一起，肯定是要代码抗钉耙的，因为论武功和智慧，类图都高了那么一点点。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">乱谈类图</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果说程序是一个人，那么类图就是这个人的躯体。也就是说，光有类图，一个程序已经成型了，看上去很像那么一回事了。</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在刻画程序的静态结构方面很成功，但是在刻画程序的动态语义时很失败，至今没有一个好的解决方案，或者说，没有一个能让各方面都接受的方案。如果</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">动态语义的问题解决了，那么</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的目标就真的达到了，模型可以完全代替代码了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目前的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具，号称模型代码同步的，号称代码生成的，号称</SPAN><SPAN lang=EN-US>PIM/PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转换的，大部分都只是和类图打交道罢了。因为类图和代码之间的转换是如此自然，以至于出现了</SPAN><SPAN lang=EN-US>Together</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的工具，模型（类图而已）和代码是同步的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图是程序的躯体，动作语义才是程序的灵魂，可惜</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在刻画程序灵魂的事情上做得太不出色了。很多研究者仅仅把目光放在类图上，类图到代码的生成几乎已经没有什么可以研究了，还是抱住不放，在生成的代码中加入约束、加入设计模式、加入持久化存储等等。怒其不争、哀其无志。想到自己也是其中的一员，不由临表涕零。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">类图难点问题总结</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图是非常容易学习的，因为它和面向对象编程是孪生兄弟，如今的程序员哪有不懂面向对象的，因此类图对于他们，就如同奶瓶对于婴儿一般。下面从硬盘中翻出一幅曾经自己画的类图，相信大家一看便知：<BR><IMG height=474 alt=image001.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/UML/image001.jpg" width=668 border=0></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><BR>类图是一门易学难精的技术，正如面向对象技术一样，一百个程序员九十九个都说自己懂面向对象，但是真正入门的可能不到十个，真正精通的也许只有一个，这个人还往往不是中国人，唉～</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自己重新学习</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的动机就来自于一次论文撰写过程中，想查阅类图的元模型图，但是问遍同行，翻遍网络，找不到合适的图形或者描述，最后只能求救于</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范。一查之下，大惊失色，原来很多东西原来都是懵懵懂懂，不甚了了。因此痛下决心，要弄懂类图中的疑点。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">翻看类图，我发现有如下是疑点所在：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>Attribute</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>Property</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的关系如何？区别和共同点是什么？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">完整的描述一个操作（</SPAN><SPAN lang=EN-US>Operation</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），需要多少东西？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类之间可以有关系（</SPAN><SPAN lang=EN-US>Relationship</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），关系可以是关联（</SPAN><SPAN lang=EN-US>Association</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）或者泛化（</SPAN><SPAN lang=EN-US>Generalization</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），这个你知道么？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关联有七种：普通关联、递归关联、限定关联、或关联、有序关联、三元关联、聚合（聚合和组合），各自有什么含义？用法如何？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关联类（</SPAN><SPAN lang=EN-US>Association Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）的含义如何？应用场景如何？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类的实例化是对象，关联的实例化是什么呢？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">总结出了这些疑点要归功于中文</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">书籍的模糊和混乱，或者是翻译者的语焉不详。所以让我在复习时找出了这么多的疑点。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">要查阅资料，解决疑难，并举例说明，起码需要</SPAN><SPAN lang=EN-US>3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>4</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">天的时间，因此这篇随笔就作为类图的引文先发了。也希望志同道合者和我一起研究上面的问题。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">后记</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">周末了，想偷懒了，结果适得其反，刚刚完成这篇</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">就停电了，后面的几百字全没了。这一点告诉我们，持久化存储是多么重要啊～</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/6317.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-06-17 22:26 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/06/17/6317.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序员眼中的UML(2)--克服用例图的恐惧</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/06/15/6179.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Wed, 15 Jun 2005 14:50:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/06/15/6179.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/6179.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/06/15/6179.html#Feedback</comments><slash:comments>22</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/6179.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/6179.html</trackback:ping><description><![CDATA[<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序员眼中的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">UML(2)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H1>
<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 240%">--</SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">克服用例图的恐惧</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 240%"><o:p></o:p></SPAN></H1>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在实际工作中，大部分程序员很少接触到需求分析，即使有需求分析，也是草草了事，没有用正规的方式来表达，所以一般程序员使用用例图的机会是不多的。但是却又常常在各种媒体上看见用例图，于是对一种常常出现，自己又不太熟悉的技术，会产生恐惧。如果说对</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的技术产生恐惧还是值得的话，对用例图产生恐惧是非常不值的。因为</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的技术也许要花上半年的时间才能够初步了解，而克服用例图恐惧症，则只要不到一天的时间。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">用例图初感</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一组图示符号的标准。所谓图示符号，就是一组定义好的图示，它们可以表达定义好的各种意思。用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行软件建模，就是用规定好的符号画图，这些图表达了开发人员脑中的软件系统。用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行软件建模，其难度并不比我们小时候上的美术课更难。在美术课上，一个圆形加上四根线条表示太阳，一个三角形加上一个矩形表示房子；同理，在</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的用例图中，一个椭圆表示用例，一个小人表示参与者。我并不认为它们之间有质的区别，想到我对这种小学生画图课恐惧了几年，不由得感到羞愧。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用例图是</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的九个图中较为重要和常用的一种图。常常用于软件开发的需求分析阶段，也能用于软件的系统测试阶段。简单的来说，用例图是描述系统的外部视图。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在开始设计一个软件系统时（更广义的情况下，可以用来设计任何系统），需要一种手段来发现系统的功能，用例图虽然是图示，但是这些图示隐含了一种启发系统功能的手段。其实所有的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图都只包含图示和标准，并不包含方法，但是它们往往隐含了某种方法。</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和软件开发方法的关系，很类似于汉字和语文的关系。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用例图包含了三种基本的概念：用例、角色和系统。它们可以组合起来表达系统的外部视图。而且这种表达方式是如此直观和简单。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">第一张用例图</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">画用例图是一件很简单的事情，而且感觉还很舒适，因为用例图简洁、直观。虽然用例图不能像</SPAN><SPAN lang=EN-US>HelloWorld</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一样运行，也不能生成代码，不过画一张清晰的用例图还是很有成就感的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我使用的工具是</SPAN><SPAN lang=EN-US>Eclipse+EclipseUML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件，功能不如</SPAN><SPAN lang=EN-US>Rose</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，但是是开源而且免费的（</SPAN><SPAN lang=EN-US>EclipseUML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有</SPAN><SPAN lang=EN-US>free</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">版也有企业版），而且效果也不错。第一张用例图如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=469 alt=第一张用例图.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/UML/第一张用例图.jpg" width=690 border=0>可以看出图中有一个系统（保险商务系统），两个角色（客户和保险销售员）以及三个用例（签订保险单、销售统计资料、客户数据资料），另外还有四个连接线以及一个注释。如果在纸上或者合适的工具中，画这样一张用例大概只需要五分钟吧。不过仅仅画出来是没有意义的，需要弄清楚其背后真正的含义才行。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">理解用例图</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以这样简单的理解用例图中的一些概念，<B style="mso-bidi-font-weight: normal">系统</B>（</SPAN><SPAN lang=EN-US>System</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）指的是软件系统，它可以包含一些用例，并界定系统的边界，边界之内的属于系统的功能和行为，边界之外的则不是系统所关心的内容。系统规定了一个具有某些功能的黑盒子，在系统之外看到的仅仅是这个系统的功能，而不能看到系统的内部细节。这一点也是用例图经常被用来做系统测试的原因。当然这些测试一般是黑盒测试。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.1pt; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">角色</SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Actor</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）是与系统中的用例交互的一些实体，在实际情况中，角色可以是人，也可以是其他系统或者硬件设备。在画用例图的过程中，角色往往是第一个被确定的，因为系统或者用例在开始时是模糊的，但是参与系统的角色是最容易明晰的。有了角色之后，根据角色与系统的交互，以及角色要求的功能，可以进一步确定系统和用例。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.1pt; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用例</SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Use case</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）指的是系统的功能，它是系统某个功能的所有执行动作的集合。在</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图示中它是一个椭圆，但是具体分析用例的时候需要给出这个用例的所有执行动作的步骤。例如上图中的“签订保险单”用例，就可以分为几个步骤：第一，客户发出保险单请求；第二，系统给出保险单样式表；第三，用户填写保险单样式表；第四，系统检查用户提交的保险单格式是否规范；第五，如果不规范则返回第二步，如果规范则给保险单销售员发出消息；第六，保险单销售员填写保险单；第七，保险单销售员将填写好的保险单加入数据库，并将客户资料输入客户数据库。当然，以上步骤仅仅是我想象的，我还从来没有见过什么“保险单”，这次过了一把瘾。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.1pt; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">连接</SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Assocation</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）是角色与用例的连接，表达此角色可以初始化此用例。</SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.1pt; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注释</SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Note</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）可以添加到任何地方，对用例图的不同部分加以说明。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">泛化、包含和扩展</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.1pt; mso-char-indent-count: 2.0"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">泛化</SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Generalization</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）在面向对象的技术中无处不在，它的另一个名字也许更为著名，就是“继承”。下图给出了一个使用泛化的用例图：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=537 alt=继承关系用例图.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/UML/继承关系用例图.jpg" width=686 border=0>由此可知，在用例图中，角色和用例都能够泛化。角色的泛化</SPAN><SPAN lang=EN-US>/</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">继承很容易理解，因为角色本来就是类（</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），它是一种版型（</SPAN><SPAN lang=EN-US>stereotype</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）为</SPAN><SPAN lang=EN-US>Actor</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的类，所以角色的继承直观而自然。但是用例的继承实际上分为两种情况，并不是简单的使用泛化，而是使用扩展（</SPAN><SPAN lang=EN-US>extended</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）和包含（</SPAN><SPAN lang=EN-US>include</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）两种泛化的特例。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展用于子用例的动作步骤基本上和父用例的动作步骤相同，只是增加了另外的一些步骤的情况下。包含用于子用例包含了所有父用例的动作，它将父用例作为了自己的一个大步骤，子用例常常包含一个以上的父用例。如下图：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial"><IMG height=536 alt=用例的扩展和包含.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/UML/用例的扩展和包含.jpg" width=685 border=0>小结</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关于用例图基本上也就是上面提到的这些内容了。当然，用例图还常常和类图、活动图联合使用，不过那些知识还是等其他知识完备了以后再说比较好。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我总结的画用例图的步骤如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">确定系统，拟出系统的名称，这个不难，例如电信计费系统；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">找出所有与系统打交道的角色，角色要进行一些精简和整合；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">站在角色的立场想象系统应该提供的功能，将这些功能画成系统中的用例；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于每个用例给出详细的动作步骤；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">找出用例图中角色、用例之间可能有的继承、扩展或者是包含关系；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以我现在的理解能力，认为用例图到此为止了。当然，我还可以想象，用例图会用来启发类图的构建，例如用例图中的某些部分（角色或者用例）会变成类图中的类或者接口。另外，可以想象用例图还可能会影响活动图中的流程。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">后记</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 172%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">让我恐惧了好久的用例图在今天便土崩瓦解了，心中却彷佛有一点茫然，因为我记得自己无数次的对自己说“好忙啊，这个技术肯定要花很多时间，还是以后再学吧”类似的话。当我用</SPAN><SPAN lang=EN-US>C</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候对</SPAN><SPAN lang=EN-US>C++</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样说过，然后是</SPAN><SPAN lang=EN-US>Java</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>JSP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>UML……</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">写</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不仅仅是一种爱好，对我来说，更是一种最好的学习方法，当我读小学的时候，班主任常常对我说“好记性不如烂笔头”，我当时的理解是把事情用笔记下来比用脑袋背下来更加持久（脑袋是内存？纸笔是数据库？）。但是，现在我理解到，要学习某个东西，最好的方法是用自己的语言把它表达出来，如果你能让别人理解这个技术，你自己当然已经精通了。在我写</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的过程中，常常会出现写到一半的时候猛然领悟的情况，这是因为当你在选择最佳的表达方式的时候，将你自己头脑中一团乱麻的线索都理清了的结果。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有朋友留言说，自己计算机本科毕业，在计算机领域学习了八年，竟然看不懂我的</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。这个我认为很正常，读本科的时候，所有同学都可以在一起讨论问题、实习；等到上研的时候，同学对我说他的课题，我只能模糊的听个大概，因为专业方向已经分开了；现在读博了，同学要拉着我说他的课题，我只能明白是哪个领域里面的问题，往往对这个问题的描述都听不懂了。这是因为研究方向已经非常精细的原因。我自问我的方向已经很大众化了，如果研究图像压缩算法的话，那满篇都是数学公式了；如果研究微电子技术，那么满篇都是集成电路图了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还有一点，如果我感兴趣的技术在网上已经能够找到很好的资源，那么我不会动笔去写</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">了，我会把资料下载到硬盘就好了。例如</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术，我的</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中只有两篇，第一篇是“</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的本质讨论”，总结出了别人看不到的</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本质，提出了一些新观点；第二篇是“</SPAN><SPAN lang=EN-US>XSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：转换从哪里开始”。其实</SPAN><SPAN lang=EN-US>XML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术浅显易懂，我也有很多感想和心得，不过其中只有</SPAN><SPAN lang=EN-US>XSL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在网上不能找到很好的总结资料，因此我写了那一篇。这也是我坚持原创和创新的一点反映吧。对于那种狂贴别人资料的</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，我是不以为然的。我只喜欢原创或者第一手翻译资料的</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/6179.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-06-15 22:50 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/06/15/6179.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序员眼中的UML</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/06/08/5718.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Wed, 08 Jun 2005 03:49:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/06/08/5718.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/5718.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/06/08/5718.html#Feedback</comments><slash:comments>14</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/5718.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/5718.html</trackback:ping><description><![CDATA[<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序员眼中的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">UML<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H1>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自</SPAN><SPAN lang=EN-US>1997</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年诞生以来，受到无数厂商、组织、专家学者的追捧和拥护，短短几年时间，便有一统天下之势。提起建模语言，舍</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">其谁？</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><FONT face=Arial>UML</FONT></SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">相关标准</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组织作为影响力最大的面向对象技术的机构，早早便将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">收入囊中，力捧其为标准建模语言。</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">取得成功之后，最大的着力点便是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构，而</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构的四大标准</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>CWM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，围绕着</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的技术便有三种：</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本身自不必说，版本已经到了</SPAN><SPAN lang=EN-US>2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为“建模语言的语言”，似乎就是为</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">量身定做的，虽说</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有能力创建出与</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">并驾齐驱的建模语言，但是似乎没有看到谁这么干，大家只是在努力的发展</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的“方言”，例如</SPAN><SPAN lang=EN-US>UML Profile for CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>UML Profile for EJB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等等；</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是“模型的标准存储交换格式”，为了解决不同的建模工具创建的模型不能互用的问题，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">创建了</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为模型的存储交换标准。这样一来，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具更加可以大行其道，使用不同的建模工具创建的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型可以互相交流，只要它们都基于</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><FONT face=Arial>UML</FONT></SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">相关工具</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具的多寡与优劣可以看出某个技术的受欢迎程度，在建模工具中，不说</SPAN><SPAN lang=EN-US>100</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％，大概也有</SPAN><SPAN lang=EN-US>90</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％支持了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言。最出名的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具</SPAN><SPAN lang=EN-US>Rational Rose</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，被</SPAN><SPAN lang=EN-US>IBM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">收购了；</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下面的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具</SPAN><SPAN lang=EN-US>EclipseUML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">让开发它的小公司</SPAN><SPAN lang=EN-US>Omondo</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也出名了；国内也有一个</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具，听说效果也不错，就是楚凡科技的</SPAN><SPAN lang=EN-US>Trufun Plato 2005</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。至于其他国际上有点名气的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具，更是不胜枚举，几乎有点软件实力的国家，都有自己的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当然，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不仅仅出现在专用的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具中，它也频繁出现在最新的各种开发环境中。例如编程开发环境</SPAN><SPAN lang=EN-US>JBuilder</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，具有将代码转换为</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图的功能；</SPAN><SPAN lang=EN-US>Together</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">就更进一步，直接实现了代码和类图的同步转换；</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为最优秀的开放式开发平台，拥有众多的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关插件，除了前面提到的</SPAN><SPAN lang=EN-US>EclipseUML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，比较有名的还有</SPAN><SPAN lang=EN-US>EMF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>UML2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出现之后，在</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的概念中，成为了</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一个子集（虽然</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的名气远远大于</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。因此众多的</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具中，几乎都少不了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">功能。我认为很多</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具就是从</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具直接改过来的。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><FONT face=Arial>UML</FONT></SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">使用现状</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">照理说来，如火如荼的标准和工具应该催生出如火如荼的应用才对，可是</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的使用状况实在不尽如人意。无论是身边的还是网络上的朋友，在项目中使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的都是凤毛麟角，即便使用了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也是在很小的范围内，完全没有发挥出</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％的功效。现在总结一下目前我所知道的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用现状：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">读代码时，用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具进行逆向工程，可以清晰的观察代码结构，方便理解代码。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">写代码时，由于开发平台可以自动生成</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图，因此有时观察</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图得到比较清晰的代码结构。例如</SPAN><SPAN lang=EN-US>Together</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者</SPAN><SPAN lang=EN-US>JBuilder</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等工具。当然，如果没有自动生成的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图，大部分人也不会寻找其他工具去生成</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">撰写科技论文时，使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来表达系统架构或者系统流程等。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">部分对</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">非常熟悉的程序员，在开始写代码时，先画</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图，然后利用工具生成代码，最后对代码进行扩展。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-para-margin-left: 2.0gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从上面的使用现状可以看出，很多人把</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当成一种可有可无的技术。即使使用了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也只是围绕着</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的类图，其他的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图都抛到一边去了。造成这种状况的原因，一方面固然是因为国内的正规大型软件项目比较少，软件工程技术起步很晚；另一方面是由于国内不管是架构师、系统分析员、软件工程师、程序员、测试人员等等实质上都是程序员而已，很多人是赶着鸭子上架成了架构师或者系统分析员的。这种状况下，软件工程的概念难以深入人心，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">更加成了一个国内项目的鸡肋。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-para-margin-left: 2.0gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">看看国外的架构师、</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">专家们，往往都是满脸大胡子，在计算机领域中浸淫了</SPAN><SPAN lang=EN-US>3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>40</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年；而中国最古老的程序员，也只有十几年经验，除去在黑暗中摸索的几年，有十年以上开发经验的程序员少之又少。不经历几个大型项目，要使用软件工程技术是不可能的，也是不能起到什么效果的。因此，有人堂而皇之的撰文“</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的三大硬伤”，将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">驳斥得一无是处。高喊口号打倒某东西是很容易的，关键是打倒了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">何以取而代之？</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">程序员眼中的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><FONT face=Arial>UML<o:p></o:p></FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">既然国内</SPAN><SPAN lang=EN-US>90</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％以上的软件开发人员都是程序员，那么程序员眼中的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">到底应该是什么样子的呢？我很期望有一本好书能够让程序员们快速的掌握自己所需的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">知识，遗憾的是目前还没有看到这样的一本书。无论是“三友”的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">经典教材还是国内的一些“</SPAN><SPAN lang=EN-US>xx</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">天精通</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">”都不符合这样的要求。没有一本是“有中国特色的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">教材――一本写给程序员的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">入门书”。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为一个程序员，我很了解其他同僚的心理，如果拿到一本书，翻了一个小时还没有找到可以</SPAN><SPAN lang=EN-US>run</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>HelloWorld</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>90</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％的人会大叫一声“去</SPAN><SPAN lang=EN-US>nmd</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">”，然后把书扔进废纸堆。不能怪我们急功近利，在这个技术术语满天飞，连底层平台都动荡不安的年代，谁还有时间和兴趣看一些与自己无关的东西呢？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我很能想象一个程序员，好不容易空出时间来看看最近很热的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术，当他拿到一本</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">入门以后，开始寻找对自己有用的东西。在开始的一个小时，满篇都是需求分析，</SPAN><SPAN lang=EN-US>use case</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，甚至书的作者还在饶有兴趣的介绍</SPAN><SPAN lang=EN-US>use case</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有六种译法：用例、用况、用案</SPAN><SPAN lang=EN-US>……</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对不起，老子一百年都没做过需求分析了，也不想知道这个狗屁的</SPAN><SPAN lang=EN-US>use case</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">到底叫什么。于是开始后悔在</SPAN><SPAN lang=EN-US>china-pub</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上又白花了这么多银子。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还有些书上信誓旦旦的说“学好</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，走遍天下都不怕”，如果你做需求分析，你可以用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和客户交流；如果你做系统分析员，你可以用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设计系统；如果你做程序员，你可以用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">生成程序；如果你做测试员，你可以基于</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设计测试用例。而实际情况是什么呢？国内的客户有几个懂</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">？懂</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的人差不多自己都可以把软件写出来了，还需要请你做需求分析么？别说客户了，上次听同学说和北京某大科研所的工程师们交流，无意中说起了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，在场的竟然只有一个稍微了解，而且坚持认为那是一种画图工具（那位仁兄其实也没错，</SPAN><SPAN lang=EN-US>Visio</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不就是一个画图工具么）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虽然状况如此不堪，但是</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">确实是一个很优秀的“交流语言”、“代码生成工具”和“系统设计工具”。让我们擦干身上的献血，掩埋战友的尸体，睁大迷蒙的双眼来看清</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对程序员的作用。</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有九种图，作用各自不同，基本上涵盖了软件工程的各个方面，很多人就是不堪于忍受知识不足的困惑与“侮辱”（很多程序员认为一种技术自己看不懂就是对自己的侮辱），从而放弃了整片</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">森林。他们怕的不是在</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这棵树上吊死，而是怕在</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">森林里面迷路。但是我想说，知识学习的过程就是去芜存精，找出对自己有用的东西，然后掌握之。对于程序员来说，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的价值就体现在三个方面：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一、</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是最好的交流语言，无论是与其他程序员交流，还是与领域专家、测试员或者用户交流。原因只有一点，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是标准的，就像英语一样，无论多么该死，大家还是忙着把自己的论文改成英文的。当然，在小的领域可能有更好的交流方言，但是在大而长远的交流中，使用标准的交流语言是稳妥的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二、</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是很好的代码生成工具，其实代码生成功能并不是由</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语言和规范提供的，而是由</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具提供的，而且不同的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具提供的代码生成功能还不尽相同。例如</SPAN><SPAN lang=EN-US>Rose</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供简单的代码框架生成，而</SPAN><SPAN lang=EN-US>Eclipse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件</SPAN><SPAN lang=EN-US>EMF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以生成功能丰富，提供了各种设计模式的代码包。无论如何，如果程序员可以从</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">入手来写程序，比直接敲代码要高级那么一点点。从文档、版本控制、维护、测试等各方面来说，画</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图比直接写代码都要高那么一点点。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">三、</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是很好的系统设计工具。对于程序员来说，很少用到“设计”这个词，大部分时候我们都是在“编写”或者“实现”。但是勿庸置疑，程序员的许多工作中还是需要“设计”的。包和组件之间的依赖关系、复杂操作的流程、对象之间的关联和状态、程序的部署等等，都经常是程序员的工作。那么上面的四种情况可以用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的组件图、序列图、对象图和部署图来设计。虽然，不同的程序员有不同的设计方法或者设计图例，不过，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是标准的。不要忽视标准的力量，标准的东西意味着在全世界范围内都有可能会被看懂，不标准的东西可能出了你的办公室就没人能够清晰、准确的理解了。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">后记</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>Blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">好久没有更新，因为最近一直忙于一些俗物，于是想写点清高的东西。但是写完之后再看，好像也不怎么清高，反而更俗了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">前段时间写论文时，需要用到</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的类图元模型，在</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范中寻觅了好久，发现类图元模型已经被拆分到三个包里面了，因为</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范实在是太大太繁琐了。于是有感于</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之博大精深，说好听是博大精深，难听点就是乱七八糟。不过</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">历来如此，当初的</SPAN><SPAN lang=EN-US>CORBA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果更简约一点，也许</SPAN><SPAN lang=EN-US>J2EE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">根本就没有立足之地。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">感慨之后就是想把</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中对自己有用的部分整理出来，在整理之前免不了到处翻资料，这篇文档就是翻资料的一些感触了。希望能够将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的有用部分都整理出来，形成一个系列的文档。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/5718.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-06-08 11:49 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/06/08/5718.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORM随想</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/05/22/5060.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sun, 22 May 2005 12:21:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/05/22/5060.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/5060.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/05/22/5060.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/5060.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/5060.html</trackback:ping><description><![CDATA[<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">ORM</SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">随想</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H1>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">前言</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">周末的夜晚，总显得特别无聊，总看卫斯理的书不是办法，得找点事情干干。前几天为了验证自己的一个想法，到网上搜索，结果发现了</SPAN><SPAN lang=EN-US>hibernate</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，为了跑一跑</SPAN><SPAN lang=EN-US>hibernate</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，结果学习了</SPAN><SPAN lang=EN-US>Ant</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，最后发现</SPAN><SPAN lang=EN-US>hibernate</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一个</SPAN><SPAN lang=EN-US>ORM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工具，于是自然把视线转移到了</SPAN><SPAN lang=EN-US>ORM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。在网上的资料中游荡，发现对于</SPAN><SPAN lang=EN-US>ORM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">没有一个完整的中文资料，</SPAN><SPAN lang=EN-US>English</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的资源也不甚明了。于是有必要把自己所看、所想、所用的做一个小小的总结。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><FONT face=Arial>ORM</FONT></SPAN><SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">的定义及来由</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>ORM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>Object-Relational Mapping</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的简称，中文含义是“对象――关系映射”。此处的“对象”，乃是</SPAN><SPAN lang=EN-US>Object Oriented</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（面向对象技术）中的对象，而“关系”则是关系数据库中的关系。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为什么需要</SPAN><SPAN lang=EN-US>ORM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">呢？自然是因为需要将对象和关系互相转换，而为什么需要互相转换，就需要解释一下“程序”的概念。最早关于程序的概念是：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序＝算法＋数据结构</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而在信息处理领域，目前我们实际面对的程序概念是：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序＝数据＋数据处理</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">计算机的程序有两个大的应用领域：科学计算和信息处理，最初的计算机程序大部分是为了进行科学计算的，这也是为什么在早期的大学中计算机系是数学系的一个分支的原因。而随着计算机技术的不断发展，尤其是网络技术的发展，信息处理已经成为计算机重点关注的问题。“信息技术”（</SPAN><SPAN lang=EN-US>Information Technology</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>IT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）产业也不断发展状态，甚至脱离了计算机技术的领域，自立门派了。说了那么多，其实就是为了说明一个问题，目前的计算机程序，大部分是为了进行信息处理的，而进行信息处理的程序，就等于数据＋数据处理。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而目前程序中的数据大部分是保存在关系数据库中的。目前程序的数据处理流程大部分是用面向对象语言编写的，因此</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序＝关系数据库＋面向对象语言</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个等式在大部分状况下成立。面向对象语言中的基本信息存储单位是“对象”，而关系数据库中的基本信息存储单位是“记录”。那么，当程序需要在数据的处理和数据的存储之间交换信息时，不可避免的要将“对象”和“记录”进行转换。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关系数据库的理论基础是关系代数，面向对象语言的理论基础是面向对象技术，如果能够在具体的程序编写之前解决“对象”和“记录”的映射问题，提出一个通用的解决方案，那么一定能够大大加快程序开发的效率和质量。这个通用的解决方案在部分上已经实现了，就是</SPAN><SPAN lang=EN-US>ORM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">力有未逮，下次再续</SPAN><SPAN lang=EN-US>……<o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/5060.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-05-22 20:21 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/05/22/5060.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ant-最终还是要学的一门手艺</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/05/18/4806.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Wed, 18 May 2005 13:45:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/05/18/4806.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/4806.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/05/18/4806.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/4806.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/4806.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Ant-最终还是要学的一门手艺最初注意到Ant是在ArcStyler这个著名的MDA工具之中，既然是MDA工具，当然要具备很多“自动”的功能。自动的从流程图到代码的生成，自动的代码编译和配置功能，自动的临时目录清理功能。而这些自动的功能中，很多来自于一个小小的“爬虫”一样的图标。这就是我后来意识到鼎鼎大名的Ant了。现在当然知道了，从最著名商务软件开发环境JBuilder到最著名的开源ID...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/05/18/4806.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/4806.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-05-18 21:45 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/05/18/4806.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Lambda演算学习笔记</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/05/15/4311.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sun, 15 May 2005 12:53:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/05/15/4311.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/4311.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/05/15/4311.html#Feedback</comments><slash:comments>15</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/4311.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/4311.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 前言blog好久没有更新了，上次更新还是4月28号。这段时间实在是很忙，4月的最后一周为了赶一篇论文，累死累活，最后在tom的帮助下总算在4月30号截稿之前完成了。4月29号的晚上一直改到了第二天凌晨3点才睡。4月30号下午回家，可是没有料到长沙的八一路修路，路上堵车。打的从学校到火车站花了40分钟，平时只要15分钟的。于是在最后10分钟一路狂奔，终于在开车前1分钟上车了。五一长假的第...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/05/15/4311.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/4311.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-05-15 20:53 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/05/15/4311.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>学术交流杂想</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/04/28/3898.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Thu, 28 Apr 2005 14:59:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/04/28/3898.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/3898.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/04/28/3898.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/3898.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/3898.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">度过了最繁忙的一周，</SPAN><SPAN lang=EN-US>blog</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也有一周没有更新了，每天生活在忙碌之中，虽然在保持思考，却没有时间记录下来。今天晚上终于有一点点空闲，记录下一点思考所得。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">因为本周一要到中南大学作一个学术交流报告，所以上周末一直在准备这个报告的</SPAN><SPAN lang=EN-US>ppt</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。报告取得了令人满意的结果，本来以为是一个较小范围的报告，没想到来了大概</SPAN><SPAN lang=EN-US>200</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">多研究生，整个小礼堂几乎坐满了。报告从下午</SPAN><SPAN lang=EN-US>4</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US>30</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">持续晚上</SPAN><SPAN lang=EN-US>7</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US>00</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>4</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个报告人才完成报告，中途退场的人却很少。本来在我的映像中，能够饿着肚子听报告的研究生应该很少，没有想到中南大学的学生们竟然对此已经习以为常了。在退场之后，大约有</SPAN><SPAN lang=EN-US>20</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">多个学生找研究生会的组织人员签字，原来他们对于研究生的毕业要求中有一项参加报告的次数。不过大部分的同学还是自愿来听的。可以说，好的制度能够营造好的氛围，而好的氛围也容易产生好的制度。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本周中，还给研究生上过两次课，主要还是讲</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术的一些概念和工具。刚刚从本科升上来的新硕士们，对于怎样做学问还是一头雾水，吸收知识很快，但是不太懂得如何交流，如何自己去掌握一个知识体系。导师们大多太忙，不能够一一指导，那么个人的悟性往往决定了一个人的研究成果。这是很可悲的一件事情，很多天资很高的学生往往因为忽视了和别人交流而局限在一个很小的圈子里面，浪费了自己的时间和天分。其实，多和自己的师兄师姐们聊聊，能够得到最直接的帮助，有时候我觉得遇到一个好的师兄比遇到一个好的导师更重要。很幸运的是，在我刚刚上硕士时真的遇到了一个好的师兄，不幸的是他毕业太早了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们很幸运能够生活在一个网络时代，无限的网络资源带给我们前辈们无法想象的便利。可惜很多人不知道如何利用网络资源，只知道一味的在</SPAN><SPAN lang=EN-US>google</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上搜索</SPAN><SPAN lang=EN-US>paper</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，多看</SPAN><SPAN lang=EN-US>paper</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">固然有益，可是往往到达一个高度后无法拔高了。因为你只看到了别人表面的东西，没有了解他们的动机和整个过程。要想提高自己的水平，还是要靠多和人交流。本周在赶一个英文论文，由于很久没有写英文了，其郁闷程度可想而知。幸好在最困难的时候有“</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和简化开发”</SPAN><SPAN lang=EN-US>qq</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">群里面的兄弟伸出了援助之手，委员向我荣誉推荐归国研究生</SPAN><SPAN lang=EN-US>tom</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">大侠为我修改论文。一时之间，我感动得泪雨滂沱，不能自已。虽然我也偶尔在网上帮别人改改论文，出出点子，但是还是第一次遇到这么得力的帮助，让我深深的感谢网络这个工具。目前已经加入了</SPAN><SPAN lang=EN-US>7</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个</SPAN><SPAN lang=EN-US>qq</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">群，中有数百个网友，大部分都是讨论某种技术的，有段时间</SPAN><SPAN lang=EN-US>qq</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实在是不堪重负，每次启动如蜗牛一般，只好忍痛退出了一些</SPAN><SPAN lang=EN-US>qq</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">群。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我也有幸参加过一次国内的学术会议，可是在我看来，彷佛不是开会而是旅游来了。不过无论如何，有两点大的收获：第一知道了国内同行们在关注什么技术，在做什么方面的研究；第二认识了一些志同道合的朋友，可以通过网络进行一些交流。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在我看来，学术是在交流中成长的，只有好的学术氛围，才能够出高水平的成果；只有思维的碰撞，才能擦出最闪亮的火花。说实话，很多国内大学的学术氛围比国外差太远，不过在网络时代，我们终于可以营造属于自己的学术圈子，在网上论战或者开交流会。互联网确实是传统教育的一个最大的补充者。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">心有所感，即兴而作，时间仓促，可能有些地方词不达意，如有意见，盼早为告之。</SPAN><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/3898.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-04-28 22:59 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/04/28/3898.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MTF初体验</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/04/17/3387.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Sun, 17 Apr 2005 14:32:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/04/17/3387.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/3387.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/04/17/3387.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/3387.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/3387.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: MTF释疑MTF是IBM开发的一个模型转换工具。它是一个Eclipse插件，可以直接在Eclipse平台上使用，也可以以Java包的形式在Java语言中使用。它的大部分功能要基于EMF和UML2这两个Eclipse插件。MTF是模型转换工具，主要用来在模型之间进行转换，例如从UML模型到EMF模型的转换，或者从UML到XSD之间的转换。因为代码生成也算是一种模型转换，所以MTF也可以用于一...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/04/17/3387.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/3387.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-04-17 22:32 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/04/17/3387.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MTF(Model Transformation Framework),一日散记</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/04/07/2887.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Wed, 06 Apr 2005 16:41:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/04/07/2887.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/2887.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/04/07/2887.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/2887.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/2887.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一日散记：BLOG竟然坏了一天，补贴昨天的。上午OCL的研究终于告一段落，至于建立一个用OCL约束的UML工程的完整例子，要等辅导的那个学生学完OCL再进行。因此今天马上投入模型转换的研究。模型转换的伪代码看得多了，始终没有试过一个可以run的工具，那么就从MTF（Model Transformation Framework）开始吧，毕竟是IBM开发的，实力强大。况且阿飞说还不错的。...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/04/07/2887.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/2887.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-04-07 00:41 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/04/07/2887.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>漫谈OCL概念、特征和实践</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/04/04/2858.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Mon, 04 Apr 2005 14:42:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/04/04/2858.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/2858.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/04/04/2858.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/2858.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/2858.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 漫谈OCL概念、特征和实践闲聊：Jos Warmer的Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition》终于看完了。这是一本不可多得的好书，一本好书可以让人节约很多的时间，其实我一直在寻找MDA相关规范的书，这本OCL是我认为最好的一本。关于MOF规范一直没有由浅入深的教程。...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/04/04/2858.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/2858.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-04-04 22:42 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/04/04/2858.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OCL和MDA</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/03/29/2591.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Tue, 29 Mar 2005 14:33:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/03/29/2591.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/2591.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/03/29/2591.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/2591.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/2591.html</trackback:ping><description><![CDATA[<H1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">OCL</SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 240%">MDA<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H1>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">闲聊：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我的</SPAN><SPAN lang=EN-US>BLOG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">又是一周没有更新了，倒不是因为懒，而是上周的大部分时间花在审阅两篇稿件上了。而尚未发表的稿件不能公开讨论，所以</SPAN><SPAN lang=EN-US>BLOG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上面就空空如也了。这几天集中精力读《</SPAN><SPAN lang=EN-US>Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">》这本书，颇有心得。作者</SPAN><SPAN lang=EN-US>Jos Warmer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的创始人，他对于这门语言的把握是最专业的，而且行文流畅，读原著如同读汉语一样，不由得大发感慨，“好书即是好老师”。全书一共十章，分为两大部分，第一部分</SPAN><SPAN lang=EN-US>User Manual</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包括前五章，主要讲述</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的由来、概念、简单的使用和实现方法，以及与</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的关系等；第二部分</SPAN><SPAN lang=EN-US>Reference Manual</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">内容要深一些，讲述了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一些高级使用方法。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这几天奋起疾“书”，以一天一章的速度看完了前五章，脑中彷佛有豁然开朗之感，尤其对于</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的关系有了新的认识。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>OCL</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">和</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>MDA</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">的初感想</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">要谈</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之间的关系，先要搞清楚它们各自的定义。</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的定义上次已经说过了，再贴过来看看：</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图（例如类图）通常不够精细，无法提供与规范有关的所有相关部分。这其中就缺少描述模型中关于对象的附加约束。这些约束常常用自然语言描述。而实践表明，这样做经常造成歧义。为了写出无歧义的约束，已经开发出几种所谓的“形式语言”。传统上的形式语言，缺点是仅适合于有相当数学背景的人员，普通商务或系统建模者则难以使用。</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">即为填补这一空白而来。它是一种保留了易读易写特点的形式语言。它已在</SPAN><SPAN lang=EN-US>IBM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的保险分部作为一种业务建模语言开发出来，根植于</SPAN> <SPAN lang=EN-US>Syntropy </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的定义如下：</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提出的一种新的软件开发方法，它定义了基于模型的开发过程，以及自动将模型映射到实现的方法。它提供了一种使用模型来指导系统的理解，设计，构造，开发，操作，维护和修改的方法。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直观的来说，</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义的一种软件开发方法，为了标准化这种开发方法，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义一组规范来支持</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，其中最重要的有：</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>CWM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。目前</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>XMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的最新版本都是</SPAN><SPAN lang=EN-US>2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>CWM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不知道，本身就不熟悉它）。在</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范中，用了一个单独的部分来专门定义</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的较早版本中已经定义，不过没有作为单独的部分来定义）。这说明，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的关系是：</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">众多标准中的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标准中的一个子标准。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">但是</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的重要性如何呢？</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">模型成熟度（</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>Modeling Maturity Levels</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>MML</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">）</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在书中我首次见到了</SPAN><SPAN lang=EN-US>MML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的概念，当然不一定是本书作者提出的，只不过是我以前孤陋寡闻罢了。</SPAN><SPAN lang=EN-US>MML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指出了模型在你的软件开发过程中扮演了一个什么样的角色？并且指出了为了提高软件开发效率你应该采取什么样的措施。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下图画出了</SPAN><SPAN lang=EN-US>MML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的六层示范图：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">&nbsp;<SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <IMG height=572 alt=image001.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/OCL/image001.jpg" width=412 border=0><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN><BR><BR><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></SPAN>&nbsp;&nbsp;&nbsp; 第零层：没有标准：模型存在于开发者的头脑中；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第一层：文本表达：用自然语言写下想法；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第二层：文本和图：用自然语言以及一些图来表达想法；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第三层：模型和图：用建模语言描述的图来表达模型，用自然语言加以辅助描述；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第四层：精确的模型：用一致而连贯的文本</SPAN><SPAN lang=EN-US>/</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图来精确的描述模型，它们都是没有歧义的，可以直接映射到编程语言；</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第五层：只有模型：第五层的模型是对于系统的一个完备的、一致的、详细和精确的描述。它足以进行全部的代码生成工作，生成的代码不需要任何改动即可运行。总而言之一句话：“模型可运行”！</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">通过以上</SPAN><SPAN lang=EN-US>MML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的描述我们可以了解，如果使用</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述模型，但是不使用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述模型中的约束，那么只能达到第三层。如果使用</SPAN><SPAN lang=EN-US>UML+OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，那么模型就是精确的，</SPAN><SPAN lang=EN-US>MML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以达到第四层。如果模型可以达到</SPAN><SPAN lang=EN-US>MML5</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，那么是我睡着了。。。当然我们坚信</SPAN><SPAN lang=EN-US>MML5</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">总有一天会达到，那时我们就可以像使用高级语言一样使用建模语言，而像不理今天的汇编一样不理明天的高级语言。也许有一种叫做</SPAN><SPAN lang=EN-US>MVM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Model Virtual Machine</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）的东西就像今天的</SPAN><SPAN lang=EN-US>JVM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一样流行。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>OCL</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">用在了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>MDA</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">的哪些方面？</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从上一节可知，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的必要条件，但远远不是充分条件。但不可否认的是，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">被广泛用于</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的各个方面。下面的两张图可以说明一部分问题：<BR></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=267 alt=image003.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/OCL/image003.jpg" width=505 border=0><BR><BR><IMG height=416 alt=image005.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/OCL/image005.jpg" width=480 border=0><BR>第一张图是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一个典型的开发流程，建立</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，描述转换定义，利用转换工具将</SPAN><SPAN lang=EN-US>PIM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转换为</SPAN><SPAN lang=EN-US>PSM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。第二张图是</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">典型开发流程中的使用。其中三个方面使用了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：第一是</SPAN><SPAN lang=EN-US>model</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的创建使用了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述模型中的约束；第二是模型转换的定义可以使用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述；第三是建模语言可以使用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来创建。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">其中让人迷惑的是第一和第三有什么区别呢？用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来约束模型和用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来创建建模语言有什么区别？区别在于它们所属元层次的不同，也就是</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中所描述的模型层次不同。这不是绕口令！其实我刚刚接触</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候也认为模型、元模型、元元模型好像绕口令一样，但这些概念在接触中慢慢清晰起来。用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来约束模型是处于</SPAN><SPAN lang=EN-US>M1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层，其模型是指对系统的描述，例如对一个信用卡管理系统的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模型。而用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来建立建模语言是处于</SPAN><SPAN lang=EN-US>M2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层，这时</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是用来描述</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的元模型中存在的约束，因为元模型等于模型的语言，也就是用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来创建建模语言（可能叫用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来定义建模语言中的约束更好）。下面是一个</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">元模型中使用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的例子：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>context Interface</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>inv: features-&gt;select(f |f.oclIsKindOf( Attribute ) )-&gt;isEmpty()</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式说明，接口</SPAN><SPAN lang=EN-US>Interface</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中不能有属性存在。如果</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的元模型中缺少</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的描述，那么此元模型就不是一个“精确”的元模型，那么</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也就不是一个精确的建模语言了。那么</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">就离我们而去了！</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>OCL</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">，约束自己，约束父亲</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由上可知，虽然</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">号称“对象”约束语言，其实它可以对</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的模型层次中的任一层次进行约束，从而表达出精确的模型（四层模型中任一层的模型）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以约束</SPAN><SPAN lang=EN-US>M2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层的模型，例如</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的元模型，而</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的元模型也处于</SPAN><SPAN lang=EN-US>M2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层，那么</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否可以约束自己的元模型呢？答案是肯定的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG height=426 alt=image007.jpg src="http://www.blogjava.net/images/blogjava_net/wxb_nudt/OCL/image007.jpg" width=513 border=0><BR><BR>上图是</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的元模型简化图，其中也用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对一些地方进行了描述：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>context LoopExpression</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>inv: source.oclIsKindOf( Collection )</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>inv: iteratorVariable.type= source.oclAsType(Collection).elementType</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上面的约束表达了</SPAN><SPAN lang=EN-US>LoopExpression</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中</SPAN><SPAN lang=EN-US>source</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的类型必须是</SPAN><SPAN lang=EN-US>Collection</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，而迭代子</SPAN><SPAN lang=EN-US>iterator</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的类型必须是</SPAN><SPAN lang=EN-US>source</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个</SPAN><SPAN lang=EN-US>Collection</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的元素的类型。由此可见，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的元模型也需要</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来约束，否则这个元模型就是不“精确”的，可以说，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在某种程度上自定义了自己。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从</SPAN><SPAN lang=EN-US>M0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（对象），</SPAN><SPAN lang=EN-US>M1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（模型）到</SPAN><SPAN lang=EN-US>M2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（元模型）都可以用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述，那么</SPAN><SPAN lang=EN-US>M3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层呢？定义</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">元模型的元模型</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，是否需要用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来约束。答案是肯定的！</SPAN> <SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">随便举一个例子：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>[1] The multiplicity of Association::memberEnd is limited to 2 rather than 2..* (i.e. n-ary Associations are not supported).</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>context Association inv: memberEnd-&gt;size() = 2</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>[2] The type of Operation::raisedException is limited to be Class rather than Type.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>context Operation inv: raisedException.oclIsType(Class)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">约束</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">说明</SPAN><SPAN lang=EN-US>Association</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>memberEnd</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的数量必须是</SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也就是说</SPAN><SPAN lang=EN-US>Association</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只能有两个</SPAN><SPAN lang=EN-US>memberEnd</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；约束</SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">说明</SPAN><SPAN lang=EN-US>Operation</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">抛出的异常类型必须是</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。以上摘自</SPAN><SPAN lang=EN-US>MOF2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范。这说明</SPAN><SPAN lang=EN-US>MOF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的定义者，父亲，同时也被</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个儿子约束着。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">后记</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中不可缺少的一环，</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">即使离开了</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还有可能使用其他的建模语言来执行，但是离开了约束各层模型的</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">恐怕就处处漏风了。</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以后很可能会作为一个单独的规范从</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中分离出来。因为它不仅仅是一个“对象”约束语言，更是一个</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">约束语言，渗透在</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的各个方面。文中还提到了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以定义模型转换，但是由于模型转换的规范</SPAN><SPAN lang=EN-US>QVT</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还没有最后确定，所以这个部分只是试探，而不是唯一标准。而目前的</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果要定义转换，还必须做一些扩充，所以这里没有介绍。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，目前我的理解也仅限于此，希望看完整本书后，能够有进一步的理解。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/2591.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-03-29 22:33 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/03/29/2591.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OCL观感：从游击队到正规军</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/03/18/2188.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Fri, 18 Mar 2005 01:51:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/03/18/2188.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/2188.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/03/18/2188.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/2188.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/2188.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">初次见到</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是在《应用</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">》这本书中，在介绍</SPAN><SPAN lang=EN-US>DBC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Design by Contract</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，契约式设计）时候提到了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，当时的感觉是</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">适合用于规定方法的前置条件和后置条件。匆匆一瞥，未能留下什么映像。再次见到</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是在</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>UML2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范中，</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">大张旗鼓的将</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的附属中分离出来，单独作为</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的一个部分，名字就叫做</SPAN><SPAN lang=EN-US>Response to the UML 2.0 OCL RfP (ad/2000-09-03)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。但是单从规范来看，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">纷繁迷乱，未见其如此值得重视之处。以后却屡屡在</SPAN><SPAN lang=EN-US>E</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文的</SPAN><SPAN lang=EN-US>paper</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中遭遇</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，最有名的就是昨天看的“</SPAN><SPAN lang=EN-US>A Relational Approach to Defining Transformations in a Metamodel</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">”，文中简直将</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为一种形式化语言来定义了元模型的转换。这下我真的看到了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的强大威力。它没有晦涩的形式化符号，却有着与其相当的表达能力，通过</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">约束的</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图才真正精确的表达了设计的概念。无论目前国内应用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的前景如何，它都是一门值得关注的技术。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">为什么要</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>OCL</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">？</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的规范是这样解释它的由来：</SPAN><SPAN lang=EN-US>A UML diagram, such as a class diagram, is typically not refined enough to provide all the relevant aspects of a specification. There is, among other things, a need to describe additional constraints about the objects in the model. Such constraints are often described in natural language. Practice has shown that this will always result in ambiguities. In order to write unambiguous constraints, so-called formal languages have been developed. The disadvantage of traditional formal languages is that they are usable to persons with a strong mathematical background, but difficult for the average business or system modeler to use.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OCL has been developed to fill this gap. It is a formal language that remains easy to read and write. It has been developed as a business modeling language within the IBM Insurance division, and has its roots in the Syntropy method.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图（例如类图）通常不够精细，无法提供与规范有关的所有相关部分。这其中就缺少描述模型中关于对象的附加约束。这些约束常常用自然语言描述。而实践表明，这样做经常造成歧义。为了写出无歧义的约束，已经开发出几种所谓的“形式语言”。传统上的形式语言，缺点是仅适合于有相当数学背景的人员，普通商务或系统建模者则难以使用。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">即为填补这一空白而来。它是一种保留了易读易写特点的形式语言。它已在</SPAN><SPAN lang=EN-US>IBM</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的保险分部作为一种业务建模语言开发出来，根植于</SPAN> <SPAN lang=EN-US>Syntropy </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法。）</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>OCL</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">的入门介绍</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><A href="http://www.mdachina.net/">Mdachina</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">论坛的笨蛋</SPAN><SPAN lang=EN-US>01</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，提供了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US><A href="http://lihuang.3322.org/mdachina/forum/dispbbs.asp?boardID=2&amp;ID=198&amp;page=1"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">入门教程</SPAN></A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，我就不再复述了。（注意论坛目前在调整期，地址可能很快过期。不过</SPAN><SPAN lang=EN-US><A href="http://www.mdachina.net/">www.mdachina.net</A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还是可以作为长期的论坛入口）</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><FONT face=Arial>OCL</FONT></SPAN><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">的特性</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之父</SPAN><SPAN lang=EN-US>Addison Wesley</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在他的著作《</SPAN><SPAN lang=EN-US>Object Constraint Language, The: Getting Your Models Ready for MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">》第二版中详细介绍了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>4</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个特性。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; tab-stops: list 18.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是查询（</SPAN><SPAN lang=EN-US>Query</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）语言也是约束（</SPAN><SPAN lang=EN-US>Constraint</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）语言：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>A constraint is a restriction on one or more values of (part of) an object-oriented model or system.</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一个约束就是对一个（或部分）面向对象模型或者系统的一个或者一些值的限制。</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类图中的所有值都可以被约束，而表达这些约束的方法就是</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>UML2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标准中，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不仅用来写约束，还能够用来对</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图中的任何元素写表达式。每个</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式都能指出系统中的一个值或者对象。因为</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式能够求出一个系统中的任何值或者值的集合，因此它具有了和</SPAN><SPAN lang=EN-US>SQL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">同样的能力。</SPAN><SPAN lang=EN-US>SQL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都不是约束语言，因为</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">既是约束语言，同时也是查询语言。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; tab-stops: list 18.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是基于数学的，但没有使用数学符号</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的基础是数学中的集合论和谓词逻辑，并且它有一个形式化的数学语义。但是它并没有使用某种数学符号。因为虽然数学符号能够清晰的、无歧义的表达事物，但是只有极少的专家可以看懂。所以数学符号并不适合用于一个广泛应用的标准语言。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自然语言是最易懂的，但是它是含混不清晰的。</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">取了自然语言和数学符号的折中方案，使用普通的</SPAN><SPAN lang=EN-US>ASCII</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">字符来表达数学中同样的概念。如果你不喜欢当前的</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达方法，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范还允许你定义自己的</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">符号集，这点是可以理解的，因为</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有一个清晰的数学语义。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; tab-stops: list 18.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">强类型的语言</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一个类型语言，任何表达式的值都是属于一个类型的。这个类型可以是预定义的标准类型例如</SPAN><SPAN lang=EN-US>Boolean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或者</SPAN><SPAN lang=EN-US>Integer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也可以是</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图中的元素例如对象。也可以是这些元素组成的集合，例如对象的集合、包、有序集合等等。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">流行的类型语义有</SPAN><SPAN lang=EN-US>Java</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>C++</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等，流行的无类型语言有</SPAN><SPAN lang=EN-US>VB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，好像</SPAN><SPAN lang=EN-US>JavaScript</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也是。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; tab-stops: list 18.0pt; mso-list: l0 level1 lfo1"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">宣言式（</SPAN><SPAN lang=EN-US>Declarative</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）的语言</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US>Declarative</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">翻译为宣言式的我不知道是否正确，但是对理解其含义并没有影响。与</SPAN><SPAN lang=EN-US>Declarative language</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相对应的是过程式的语言（</SPAN><SPAN lang=EN-US>procedural language</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。过程式语言，类似编程语言，描述了动作执行的步骤。但是在宣言式的语言中，表达式仅仅描述了应该去做“什么”，而不是应该“怎样”去做。为了保证这一点，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的表达式是没有副作用的，也就是说，计算一个</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式的值不会对系统的状态产生任何改变。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">因为</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是宣言式语言，所以</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的表达式被提升到了纯建模的领域，而不必理会实现的细节和实现的语言。表达式在高的抽象层次上规定了系统的值，从而保留了</SPAN><SPAN lang=EN-US>100</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">％的精确。</SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">从游击队到正规军</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为主流的建模语言，</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">始终处于不冷不热的地步，老像是游击队，打一枪换一个地方，很难有人将</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自始至终的贯彻。</SPAN><SPAN lang=EN-US>OMG</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">觉得“没有纪律的部队是不能打仗的”，因此加上了</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个“军令”，希望能够建设建模领域的“正规军”。但是如果要详细的用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">描述所有约束，那么在设计阶段花费的时间就会大量增加，是否能够在开发的后期得到效率和质量上的补偿呢？我们只能希望如此。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另外，</SPAN><SPAN lang=EN-US>MML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US>Modeling Maturity Levels</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，模型成熟度层次）分为</SPAN><SPAN lang=EN-US>5</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层，要想能够贯彻</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法，模型成熟度必须达到</SPAN><SPAN lang=EN-US>level4</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，即精确的模型，但是精确的模型目前只能用</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">加</SPAN><SPAN lang=EN-US>UML</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来描述。所以，</SPAN><SPAN lang=EN-US>OCL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也是通向</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的必经之路。到底它是通向</SPAN><SPAN lang=EN-US>MDA</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之路的桥梁还是绊脚石呢？</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/wxb_nudt/aggbug/2188.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-03-18 09:51 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/03/18/2188.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《在元模型中定义转换的关系型方法》读书笔记</title><link>http://www.blogjava.net/wxb_nudt/archive/2005/03/17/2153.html</link><dc:creator>wxb_nudt</dc:creator><author>wxb_nudt</author><pubDate>Thu, 17 Mar 2005 04:03:00 GMT</pubDate><guid>http://www.blogjava.net/wxb_nudt/archive/2005/03/17/2153.html</guid><wfw:comment>http://www.blogjava.net/wxb_nudt/comments/2153.html</wfw:comment><comments>http://www.blogjava.net/wxb_nudt/archive/2005/03/17/2153.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wxb_nudt/comments/commentRss/2153.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wxb_nudt/services/trackbacks/2153.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 前言：本文是模型转换领域的一篇Bible，被无数次的引用。几乎在所有的模型转换领域的论文中都会把它作为参考文献。作者在本文中第一次提出了用关系代数来定义模型转换的方法，开创了模型转换技术的一个流派。本文中涉及的知识非常广泛，读懂本文需要以下知识：关系代数、集合论、UML、OCL以及MDA相关知识。特别是OCL，文中大量的使用了OCL来描述转换的约束和特性。我是第二次读这篇文章了，第一次因为...&nbsp;&nbsp;<a href='http://www.blogjava.net/wxb_nudt/archive/2005/03/17/2153.html'>阅读全文</a><img src ="http://www.blogjava.net/wxb_nudt/aggbug/2153.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wxb_nudt/" target="_blank">wxb_nudt</a> 2005-03-17 12:03 <a href="http://www.blogjava.net/wxb_nudt/archive/2005/03/17/2153.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>