UML软件工程组织

依从UML的对象分析和设计工具1.0 beta 1 版
来源:www.Rational.com

目录

1. 服务说明

1.1 概述

1.1.1 背景

1.1.2 工具共享的方案

1.1.3 OA&D工具的典型用户

1.1.4 实例证明

1.1.5 存在的问题

1.1.6 工具的性能

1.1.7 其他所要的特性

1.1.8 简介OA&D工具接口的组成

2. 服务结构

2.1 客户的使用模型

2.2 与CORBA技术的关系

2.2.1 序言

2.2.2 CORBA核心对象模型

2.2.3 CORBA核心内容

2.2.4 CORBA服务

2.2.5 CORBA工具

3. 对象模型

4. IDL模块

4.1 接口简介

4.2 抽象接口

4.2.1 OAD_Stream 模块

4.2.2 OAD_CoarseGrainFacility 模块

4.3 具体接口

4.3.1 Behavioral_Elements 模块

4.3.2 Core_Concepts 模块

4.3.3 OAD_Facility 模块

4.3.4 Structural_Elements 模块

4.3.5 View_Elements 模块

 

1. 服务说明

1.1 概述

1.1.1 背景

本文档为瑞理公司(Rational)等组织向对象管理小组(CORBA) OADTF RFP-1 提交的文档资料的一部分。CORBA小组成员可以从网点 http://www.omg.org/member/doclist-97.html 处获得全部的提交资料(文档ad/97-01-01到ad/97-01-14)。在网点 http://www.rational.com/UML处可获得UML语言的最新资料。请把您对该文档的意见通过电子邮件发送到以下地址:UML_feedback@rational.com

RFP的一个主要的目标是实现面向对象的可视化工具之间的相互协作,进而推动软件工业的发展。OA&D工具定义了一些支持工具协作的接口。

但要想使模型信息在不同工具之间的交换具有意义,各种工具的语义和模型表示应该基本一致。在文档《UML语义》中定义的元模型说明了UML语言的语义和表示法。文档《UML到CORBAIDL的映射》讨论了如何把UML模型转换成对应的IDL模型。本工具文档中定义的IDL模型大部分都是从UML1.0版元模型直接对应过来的。

提交给CORBARFP的大多数文档都是首先定义一些接口,然后解释接口中包含的语义概念。本文档的结构稍微有一些不同。因为UML语言的语义非常复杂,我们把这部分内容放在文档《UML语义》中讨论,因此本工具文档中不包括语义内容。

1.1.2 工具共享的方案

OAD任务小组的主要工作是实现“OA&D工具之间的语义协作”。因此RFP在文档的5.5.2节指出:“提交文档必须定义支持工具访问其他工具产生的模型或模型元素的接口。模型访问工具可以是一个输入工具,也可以是连接工具,或者两者都是。”

如图所示,对象模型的共享有三种可行的方案:

库(Repository)-各种工具连接同一个库,通过库访问模型。元对象工具(MetaObject Facility,简称MOF)可以作为这样的库,尽管这并不需要持久性。MOF工具无法指定依从UML的工具的基础模型的丰富语义,因此从工具模型到MOF模型的转换与具体的实现紧密相关。提交文档没有对库方式进行过多的讨论,但在文档《UML语义》的附录中有关于工具模型到MOF模型的转换的内容。

模型传送(Model Transfer)-不同工具都支持同一种流格式,通过流(也可以是文件)来交换模型信息。RFP把这种流格式称做“输入工具”。对于没有在CORBA环境下实现的工具,为了提供一个路径,就必须定义这种接口。在文档《依从UML的交换格式》中定义了这种流格式;该格式是CDIF主题领域定义的。这种格式的流可以通过OA&D工具的接口内部化为UML模型元素或者从UML模型元素外部化而来。

模型访问(Model Access)-不同工具之间逐部分交换模型信息。RFP把这种方法叫做“连接工具”。虽然对于共享整个模型,采用模型访问的方案可能效率并不是最好,但这种方法可以允许最大限度的语义协作,对客户程序更有帮助。文档中定义了一些支持模型访问的IDL接口。还定义了一些支持把流内部化为模型或从模型外部化为流的OA&D工具接口。

总而言之,OA&D工具定义了支持模型访问和模型传送方式的接口。这些接口与文档中的UML元模型是一致的。

1.1.3 OA&D工具的典型用户

对于模型访问方式,下列客户可以使用OA&D工具:

传统的CASE工具-传统的计算机辅助软件工程工具(Computer Aided Software Engineering tools)可以通过OA&D工具接口共享模型。

制图/动画工具(Drawing/Animation Tools)-OA&D工具中包括支持模型绘制和动画的详细接口。传统的CASE工具通常把应用程序的模型和模型的图形表示合在一起。分别维护模型和模型的图形表示可以使应用程序的图表,动画和文档部分分开。

报告/代码生成工具(Report/Code Generators)-各种报告和代码的生成工具可以通过OA&D工具的接口,访问模型和模型的特征值。

商业对象工具(Business Object Facility)-虽然BOF的定义时刻在发展,但BOF可以利用OA&D工具为商业对象的逻辑和物理特性(例如,UML的组件和构件)及它们之间的关系建模。BOF可以使用文档定义的对象元模型以及模型的扩展机制来存储模型,把元对象工具作为存储商业对象实现的库。

文档的提交人员都认为为用户定义详细的接口是实现工具协作的重要内容。

1.1.4 实例证明

文档定义的规范在技术上是完全可行的。例如,瑞理公司开发的可视化建模工具 Rational Rose? 虽然不是一个CORBA环境的工具,也实现了不少特性。Rose 4.0 版中定义了一套“Rose扩展接口”(叫做“Rose Script”),包括OLE automation server格式和 Visual Basic for Applications (VBA)格式。Rose 4.0 版中定义了一套“Rose 扩展接口”,该扩展接口由OLE automation server 和Visual Basic for Applications (VBA) scripting接口(即Rose Script)共同提供。这些接口类似于文档中定义的接口。有几个报告和代码生成工具已经使用了Rose Script,包括一个IDL的代码生成器。尽管Rose Script并不是IDL的,但这些都是Rose“服务”的“客户”。

如果一些工具要实现用于信息交换的专利格式,我们认为CDIF(CASE工具数据交换格式/EIA)是比较好的选择,会得到软件工业界的广泛认可。CDIF格式的语法和编码标准是本文档的基础,已经有许多工具实现了这一标准。

1.1.5 存在的问题

这个文档被定为 1.0 beta 1版本,是因为在工具定义中还存在着许多问题。这些问题将在1997年4月以前,向CORBA提交的修改文档中得到解决。RFP包括的范围太广,它试图同时实现语义的标准化和解决工具问题。然而,对语义的长期讨论使得一些工具问题迟迟得不到解决。如下列问题:

虽然UML元模型只是一个语义模型,还没有对工具上的问题进行修改,但作为向RFP的初次提交还是可以的。在预期于1997年4月完成的修改文档中,应该定义一个独立的工具元模型作为OA&D工具的基础。UML元模型中还缺少一些工具标准所必需的行为(操作)。

为了防止模块之间的循环依赖,工具中的IDL模块一般规模都很大,而且结构也不是很好。如果不存在一个独立的工具元模型,定义相互松耦合并且规模很小的模块是很难的。对接口的依赖关系的要求不同,将导致不同的模块集。

工具定义中的IDL模块与文档《UML语义》中的元模型并不完全一致。这是因为就在向CORBA小组提交该文档之前,我们对UML的语义作了一些修改。IDL模型在有关状态和名字的内容上与UML元模型略有出入,还有我们把元模型中的模式(pattern)改成了协同(collaboration)。

在这篇文档中,我们只说明了工具的一部分用法。我们确信UML元模型中的所有语义对用户都是有用的,因此我们为所有的语义都定义了相应的接口。在修改版的文档中,我们将讨论工具的其他一些用法。

目前,工具接口所声明的异常泛指所有的异常情况,还没有具体化。

我们还需要更深入的探讨局部模型传送的语法。例如,如果一个包(package)中包含与其他包中的类的双向关联,那么输出这个包就有可能产生问题。在文档《依从UML的交换格式》中涉及到了这个问题。

虽然UML1.0版的元模型定义了表示符号位置的类及其属性,但并没有制订符号布局的标准。因此,无法保证工具实现的图表设计。

目前的类型转换还没有使用国际化的字符串。

文档的作者欢迎各位提出宝贵意见。

1.1.6 工具的性能

采用依从UML的交换格式,模型的传送可以不必实现OA&D工具,例如在非CORBA的环境中。

本工具文档定义了支持模型访问和模型传送服务的接口,这些接口基本上有两层性能:

1) 模型传送(Model Transfer)-0节中定义的“抽象”接口。

2) 模型访问(Model Access)-上述接口,及0节中定义的“详细”接口。

1.1.7 其他所要的特性

实现OA&D工具的开发人员还可以发现许多有用的特性,如(在内部化/外部化过程中间的)过滤器(filters)和查询(queries)。工具开发人员还应该考虑定义和实现其他有价值的特性。

1.1.8 简介OA&D工具接口的组成

本节讨论工具的接口类型。大部分的接口直接对应于UML的元模型。还有一些接口是从CORBA服务中继承来的。

1.1.8.1 对应于UML元模型的接口

作为一个基本的前提,OA&D工具的用户应该能够随意查看和管理一个模型。因此,我们为整个模型定义了接口。

文档《UML到CORBAIDL的映射》中定义了可以直接从UML元模型导出的IDL模块的基本构件,主要包括:模块,界面,类型定义,枚举,异常,结构,常量,联合,属性和操作。

另外,还定义和使用了几个转换模式:

集合(Collections)-集合定义于使用集合服务的特定关联上。集合与集合服务的关系将在后面讨论。

关键字/限定关系(Keys/Qualifiers)-添加了按名字查找的操作。

关联类(Association Classes)-继承于LifeCycle。

1.1.8.2 内部化和外部化

首先明确那些用于工具间传送,表示局部模型的抽象“块”。主要有如下UML元素:系统,模型,包和图。

如外部服务(Externalization Service)中定义的那样,在工具的实现中,这些块都是“可流动的”,可以从内部化进工具和从工具外部化而来流的格式可以是文档《依从UML的交换格式》中定义的CDIF。小一些的块和单个模型元素也可以通过OA&D工具的其它接口在工具之间交换。

在内部化/外部化过程中发生的传送“转换”的语义在文档《依从UML的交换格式》中讨论。文档还讨论了名字域和对复用有重要意义的局部模型传送等概念。转换的语义并不影响工具接口的定义。

工具与外部服务的关系在以后深入讨论。

1.1.8.3 生命周期服务

工具定义了工厂(Factories)及其它的一些生命周期接口。这在以后详细讨论。

1.1.8.4 扩展

明确关键的UML扩展机制,特征值(tagged value),是有用处的。通过工具的接口,可以使用特征值把任意数目的未注册、未说明的索引包括到模型中。这可以作为一种结合机制,例如,在模型中添加从对象模型构件到构件实现的索引。

2. 服务结构

2.1 客户的使用模型

下面的两个图分别描述了内部化和外部化一个流对象(如包)的过程。这些图说明了依从UML的交换格式(CDIF)的使用方法。

在修改文档中将会给出其它的一些使用方法。

2.2 与CORBA技术的关系

2.2.1 序言

这一节主要讨论依从UML的OA&D工具接口与已经采纳或正在审查的各种CORBA技术之间的关系。UML语言与CORBA技术的语义关系在文档《UML语义》的附录M4-《与CORBA技术的关系》(97-01-07)中讨论。

一般情况下,人们总是尽量减少工具与服务之间的接口依赖,因此这里我们只讨论工具与下列服务之间的接口关系:数据类型,集合服务(collection service),生命周期服务(lifecycle service)和输出服务(externalization service)。

对依从UML的OA&D工具的实现很有可能会增加一些功能和接口依赖关系。因此有必要提醒读者注意,我们所讨论的是OA&D工具的接口而不是工具的实现。文档不讨论OA&D工具的实现与CORBA技术的关系。

2.2.2 CORBA核心对象模型

OA&D工具与CORBA核心对象模型没有什么接口上的关系。

2.2.3 CORBA核心内容

本节所讨论的内容包括CORBA2.0版和其它一些不属于CORBA2.0版的内容。也就是说,包括那些已经被认可但还没有正式出版的CORBA标准。

2.2.3.1 CORBA2.0版

我们使用CORBA数据类型的结构类型来定义基本的UML类型。

2.2.3.2 IDL类型扩展

OA&D工具应该采用这个标准中定义的“国际化”字符串。相对于其它的格式来说,工具应该采用UNICODE 4-byte标准字符串。

2.2.3.3 多重接口

OA&D工具接口与这一标准的关系将在修订版的文档中讨论。

2.2.3.4 COM/CORBA协作

OA&D工具接口与这一标准的关系将在修订版的文档中讨论。

2.2.3.5 其它的CORBA核心内容

工具与下列内容之间没有接口关系:

OMGCORBA对象模型

界面库

IDL固定点扩展(IDL Fixed Point Extensions)

通用安全IIOP(Common Secure IIOP)

SYSMAN

CORBA可协作性(CORBAInteroperability)

语言变换(Language Mappings)

CORBA安全管理(CORBASecurity)

2.2.4 CORBA服务

目前,依从UML的OA&D工具接口定义直接依赖于生命周期和外部化这两个服务。下面讨论工具与各种服务之间的接口关系。

2.2.4.1 生命周期服务(Life Cycle Service)

OA&D工具接口依赖于生命周期服务规范。UML工具模型中的Element类直接继承于CosLifeCycle模块。工具接口还采用了生命周期服务中定义的基本工厂/生命周期(factory/lifecycle)机制。

2.2.4.2 输出服务(Externalization Service)

输出服务(简称ES)规范定义了输入和输出对象的协议和约定,及标准的文件或流格式(即标准流数据格式(Standard Stream Data Format),简称SSDF)。对应于关系服务中的元模型构件,外部服务还定义了低抽象层次上详细的对象的外部化。

ES规范的严格性是由内部化和外部化特性和服务中的方法和对象决定的。另外,ES规范对于数据的格式是非常宽松的;规范指出:“可以支持多种不同的外部化数据格式和存储介质……”(ES第9页)。ES服务和依从UML的交换格式(UML-Compliant Interchange Format)之间是互补的关系。

提交文档中的依从UML的交换格式是基于CDIF标准定义的。它可以通过各种方法与ES服务交互。这些方法将在下面详细讨论。

虽然这些格式的宗旨有一些类似,但在具体的细节上有很大不同。文档不讨论ES标准流数据格式和CDIF的不同之处。

目的

元对象工具和OA&D工具的提出是为了定义比CORBA核心对象模型、CORBA核心模型、界面库和输出服务所基于的关系服务更丰富的语义和相应语法。OA&D元模型与这些及其他CORBA标准的语义关系在附录M4《与CORBA技术的关系》(97-01-07)中单独讨论。

有必要讨论一下OA&D文档中定义的工具接口与ES服务的具体关系。主要从以下三个方面进行讨论:

语义基础

输出协议

CORBA对象的外部表示

 

CORBA对象的外部表示

ES标准流数据格式中定义的外部表示,如文件格式,和CDIF不同。交换语法和编码(Interchange Syntax and Encoding)使用OA&D工具中的丰富的语义进行编码,这一点是很重要的。否则,不同抽象层次间的翻译就很可能会引起错误和混淆。

我们选择了CDIF的编码而没有选择外部服务中定义的编码。这是因为:

CDIF的定义与元模型转换的详细程度是一致的;

有许多工具实现了CDIF;

在不同的情况下,CDIF可以以不同的结合方式与ES服务连接,以获得最大限度的可移植性和使用效率。


采用CDIF标准的其它理由在文档《依从UML的交换格式》中讨论。

ES服务和CDIF的不同结合方式

下面的三个图说明了CDIF与CORBA外部服务的三种结合方式。这些图是按照从不需要ES服务到充分利用ES服务的顺序排列的。

图1 - 从CASE工具到CDIF

 

图1(上图)说明了不使用外部服务从CASE工具输出转换模型的步骤。这种方法适合在没有ES服务的环境中进行模型传送转换。对于多重传送转换,CDIF标准提供了一个灵活的格式载体,可以直接转换成分析和设计元模型。

图2 - 从CASE工具到ES服务到CDIF

 

图2(上图)说明了通过采用CASE数据交换格式(Case Data Interchange Format,即CDIF)的外部服务,从CASE工具输出转换模型的步骤。图中,采用CDIF外部服务的功能。这种方法实现了与CDIF标准的多重工具移植相结合的标准流机制的ES特性。

图3 - 从CASE工具到ES/CDIF到CDIF

 

图3(上图)说明了通过采用标准流数据格式(Standard Stream Data Format,即SSDF)的外部服务,从CASE工具输出转换模型的步骤。CDIF包含在SSDF的对象信息(Object Info)部分。这种方法实现了与CDIF标准的多重工具移植相结合的标准流机制的ES特性、可移植性和分布性。

2.2.4.3 集合服务(Collection Service)

OA&D工具使用了集合服务(也称对象集合服务)中定义的集合,而不是序列(sequences)。工具的IDL模型采用了通用的集合,但在工具的实现中可以使用有序集合或者其它集合。这些集合的接口都是相同的。集合服务还添加了一些操作,如add、remove、replace和iterators。为了采用某些类型安全机制,工具的IDL模型还对集合作了类型定义。

2.2.4.4 命名服务(Naming Service)

只是在OA&D工具的实现部分才需要给用户对象链接名字和解开名称约束。例如,在输入或输出部分模型的过程中,如包。因此,虽然工具的实现依赖于命名服务,但工具的规范与命名服务没有关系。

使用命名服务只是为了更好的对聚集(aggregation)进行管理。聚集和名字域都是UML语言预先定义的概念。UML自己执行命名规则(例如包),因此不必赋予用户对命名空间的更多控制。

命名服务仅限于UTS-8或ISO Latin。这也是一个问题。

注意不要因为可量测性问题(scalability issues)混淆了命名服务和生命周期服务。OA&D工具所依赖的是生命周期服务。

2.2.4.5 事件(通知)服务(Event Service)

当某些模型或视图元素发生改变时,OA&D工具可能需要给客户发送一个通知。工具的客户,如制图工具,可能希望在模型发生改变时更新模型的图形。工具的规范中并不包括这些特性,但如果工具开发者愿意实现这些特点,实际上并不会发生什么矛盾。

2.2.4.6 查询服务(Query Service)

查询服务(QS)中定义的集合已经被集合服务(CS)所取代,因此我们采用集合服务,而不采用查询服务中的集合。

查询服务所提供的查询功能是很有用的,但OA&D工具并不一定必须使用查询功能。因此,我们没有定义OA&D工具与查询服务的接口关系。例如,我们没有采用“模式匹配”之类的查询功能,而是为集合/重复定义了按名字查询的接口。如果客户想知道“模型中何处使用了某个对象”,可能会需要完全的查询功能。但这是高级的功能,而不是基本功能。

2.2.4.7 其它服务

OA&D工具与下列服务没有任何接口关系:

持久对象服务(Persistent Object Service)

对象处理服务(Object Transaction Service)

并发控制服务(Concurrency Control Service)

关系服务(Relation Service)

注册服务(Licensing Service)

属性服务(Property Service)

CORBA安全服务(CORBASecurity Service)

时间服务(Time Service)

对象贸易者服务(Object Trader Service)

2.2.5 CORBA工具

2.2.5.1 已采纳的CORBA工具

OA&D工具与下列工具之间没有任何接口关系:

系统管理工具(System Management Facility)

分布文档构件工具(Distributed Document Component Facility)(即基于 OPEN DOC 的“复合表示和交换(Compound Presentation & Interchange)”)

2.2.5.2 正在审议的CORBA工具

2.2.5.2.1 元对象工具

OA&D工具可以继承元对象工具(MOF)的某些接口,但目前还没有作这方面的定义。在修改版中会考虑是否定义这些接口。

我们之所以想在OA&D工具定义中继承MOF的某些接口,是因为MOF定义了一些工具客户向往的功能。我们将考虑如下的MOF接口:

在集合中按名字查找对象

返回对象的属性集合,可以包括对象继承的属性

返回所有的子类和超类

2.2.5.2.2 商业对象工具

商业对象工具(BOF)可以作为OA&D工具的客户。OA&D工具规范与BOF工具无关。

3. 对象模型

在文档《UML语义》中定义了UML语言的基本对象模型。

下表总结了除UML元模型中定义的继承(一般化关系)之外的所有其它的继承关系。这些UML接口对应于UML元模型继承体系中最顶层的类。另外,Streamable也继承于接口LifeCycleObject。

下图说明了抽象接口之间的继承关系。

4. IDL模块

4.1 接口简介

OA&D工具定义了下列接口模块:

粗纹(Coarse-Grained)接口:

OAD_Stream

OAD_CoarseGrainFacility

细纹(Fine-Grained)接口:

Behavior_Elements

Core_Concepts

OA&D_Facility

Structural_Elements

View_Elements


这些接口对应于UML元模型中的包。

4.2 粗纹接口

4.2.1 OAD_Stream模块

module OAD_Stream {

interface OAD_Stream : CosExternalization::Stream {}

interface OAD_StreamFactory : CosExternalization::StreamFactory {}

interface OAD_StreamFileFactory : CosExternalization::StreamFileFactory {}

interface OAD_Streamable : CosStream::Streamable {}

interface OAD_StreamableFactory : CosStream::StreamableFactory {}

interface OAD_StreamIO : CosStream::StreamIO {}

};

4.2.2 OAD_CoarseGrainFacility 模块

module OAD_CoarseGrainFacility {

typedef string Name; // should this be IString?

typedef Collection ModelCollection;

typedef Collection PackageCollection;

typedef Collection DiagramCollection;

interface System;

interface Model;

interface Package;

interface Diagram;

interface System : OAD_Streamable

{

attribute Name name;

attribute ModelCollection models;

Model add_Model();

void remove_Model(in Model theObject);

};

interface SystemFactory {

System create();

System create(in Name theName);

}

interface Model : OAD_Streamable

{

attribute Name name;

attribute PackageCollection packages;

attribute DiagramCollection diagrams;

Package add_Package();

void remove_Package(in Package theObject);

Diagram add_Diagram();

void remove_Diagram(in Diagram theObject);

};

interface ModelFactory {

Model create();

Model create(in Name theName);

}

interface Package : OAD_Streamable

{

attribute Name name;

attribute Model model;

attribute DiagramCollection diagrams;

Diagram add_Diagram();

void remove_Diagram(in Diagram theObject);

};

interface PackageFactory {

Package create();

Package create(in Name theName);

}

interface Diagram : OAD_Streamable

{

attribute Name name;

};

interface DiagramFactory {

Diagram create();

Diagram create(in Name theName);

}

};

4.3 细纹接口

4.3.1 Behavioral_Elements 模块

#include <CosLifeCycle.idl>

#include <Core_Concepts.idl>

// =======================================================

module Behavioral_Elements {

interface ActualArgument;

interface CompositeState;

interface Vertex;

interface Connector;

interface Interaction;

interface Action;

interface Transition;

interface Event;

interface Link;

interface LinkRole;

interface ActionExpression;

interface StateMachine;

interface TimeExpression;

interface Behavior;

interface Message;

interface ActionState;

interface BooleanExpression;

interface State;

typedef Collection ActualArgumentCollection;

typedef Collection CompositeStateCollection;

typedef Collection VertexCollection;

typedef Collection ConnectorCollection;

typedef Collection InteractionCollection;

typedef Collection ActionCollection;

typedef Collection TransitionCollection;

typedef Collection EventCollection;

typedef Collection LinkCollection;

typedef Collection LinkRoleCollection;

typedef Collection ActionExpressionCollection;

typedef Collection StateMachineCollection;

typedef Collection TimeExpressionCollection;

typedef Collection BehaviorCollection;

typedef Collection MessageCollection;

typedef Collection ActionStateCollection;

typedef Collection BooleanExpressionCollection;

typedef Collection StateCollection;

enum ConnectorKind {

initial, final, history

}

interface ActualArgument: CosLifeCycle::LifeCycleObject {

attribute {target,_parameter,_participant} value;

attribute Action Action_reference;

attribute Instance Instance_reference;

};

interface ActualArgumentFactory {

ActualArgument create();

};

interface CompositeState: State {

attribute Core_Concepts::Boolean isConcurrent;

attribute Core_Concepts::Boolean hasHistory;

attribute VertexCollection substate;

Vertex add_Vertex();

void remove_Vertex(in Vertex theObject);

};

interface CompositeStateFactory {

CompositeState create();

};

interface Vertex: Core_Concepts::ModelElement {

attribute StateMachine vertices;

attribute CompositeState substate;

attribute TransitionCollection source;

attribute TransitionCollection target;

 

};

interface VertexFactory {

Vertex create();

};

interface Connector: Vertex {

attribute ConnectorKind kind;

};

interface ConnectorFactory {

Connector create();

};

interface Interaction: Behavior {

attribute LinkCollection links;

attribute Structural_Elements::InstanceCollection instances;

Link add_Link();

void remove_Link(in Link theObject);

Instance add_Instance();

void remove_Instance(in Instance theObject);

};

interface InteractionFactory {

Interaction create();

}

interface Action: Core_Concepts::ModelElement {

attribute Message action;

attribute Structural_Elements::Activity activity;

Activity add_Activity();

void remove_Activity(in Activity theObject);

ActualArgumentCollection get_actual_argument();

Instance add_Instance();

void remove_Instance(in Instance theObject);

};

interface ActionFactory {

Action create();

};

interface Transition: Core_Concepts::Relationship {

attribute BooleanExpression guard;

attribute StateMachine transitions;

attribute Event trigger;

attribute ActionExpression effect;

attribute VertexCollection source;

attribute VertexCollection target;

attribute State internal_transition;

Core_Concepts::Name label;

Event add_Event();

void remove_Event(in Event theObject);

ActionExpression add_ActionExpression();

void remove_ActionExpression(in ActionExpression theObject);

Name add_Name();

void remove_Name(in Name theObject);

};

interface TransitionFactory {

Transition create();

};

interface Event: CosLifeCycle::LifeCycleObject {

attribute TransitionCollection trigger;

 

};

interface EventFactory {

Event create();

};

interface Link: Core_Concepts::Relationship {

attribute Core_Concepts::Boolean isCreated;

attribute Core_Concepts::Boolean isDestroyed;

attribute Interaction links;

attribute sequence<LinkRole,2> link_roles;

attribute Structural_Elements::Association link_instance;

LinkRole add_LinkRole();

void remove_LinkRole(in LinkRole theObject);

};

interface LinkFactory {

Link create();

};

interface LinkRole: Core_Concepts::ModelElement {

attribute Link link_roles;

attribute Structural_Elements::ValueCollection qualification;

attribute Structural_Elements::AssociationRole role_instance;

attribute MessageCollection messages;

attribute Structural_Elements::Instance player;

Value add_Value();

void remove_Value(in Value theObject);

Message add_Message();

void remove_Message(in Message theObject);

};

interface LinkRoleFactory {

LinkRole create();

};

interface ActionExpression: Core_Concepts::Expression {

attribute Transition effect

ActionCollection referencedActions();

};

interface ActionExpressionFactory {

ActionExpression create();

};

interface StateMachine: Behavior {

attribute TransitionCollection transitions;

attribute VertexCollection vertices;

Transition add_Transition();

void remove_Transition(in Transition theObject);

Vertex add_Vertex();

void remove_Vertex(in Vertex theObject);

};

interface StateMachineFactory {

StateMachine create();

};

interface TimeExpression: Event, Core_Concepts::Expression {

};

interface TimeExpressionFactory {

TimeExpression create();

};

interface Behavior: Core_Concepts::ModelElement {

attribute Structural_Elements::Pattern behaviors;

attribute Structural_Elements::InstanceCollection actions;

};

interface BehaviorFactory {

Behavior create();

};

interface Message: Core_Concepts::ModelElement {

attribute BooleanExpression guard;

attribute Core_Concepts::String sequence;

attribute Core_Concepts::Boolean isAsynchronous;

attribute {activation,_return} direction;

attribute Core_Concepts::Uninterpreted script;

attribute LinkRole messages;

attribute Structural_Elements::Instance thread;

attribute Action action;

Core_Concepts::Name label;

Instance add_Instance();

void remove_Instance(in Instance theObject);

Action add_Action();

void remove_Action(in Action theObject);

Name add_Name();

void remove_Name(in Name theObject);

};

interface MessageFactory {

Message create();

};

interface ActionState: State {

};

interface ActionStateFactory {

ActionState create();

};

interface BooleanExpression: Core_Concepts::Expression {

};

interface BooleanExpressionFactory {

BooleanExpression create();

};

interface State: Vertex {

attribute Structural_Elements::AttributeCollection state_variable;

attribute TransitionCollection internal_transition;

attribute Structural_Elements::InstanceCollection state_instance;

Attribute add_Attribute();

void remove_Attribute(in Attribute theObject);

Transition add_Transition();

void remove_Transition(in Transition theObject);

};

interface StateFactory {

State create();

};

};

4.3.2 Core_Concepts 模块

#include <CosLifeCycle.idl>

#include <CosStream.idl>

#include <Structural_Elements.idl>

// =========================================================

module Core_Concepts {

interface Note;

interface TaggedValue;

interface ViewElement;

interface Model;

interface Element;

interface ModelElement;

interface References;

interface Owns;

interface Package;

interface Time;

interface System;

interface Stereotype;

interface Relationship;

interface Constraint;

interface Dependency;

typedef Collection PointCollection;

typedef Collection NoteCollection;

typedef Collection TaggedValueCollection;

typedef Collection ViewElementCollection;

typedef Collection ModelCollection;

typedef Collection ElementCollection;

typedef Collection ModelElementCollection;

typedef Collection ReferencesCollection;

typedef Collection OwnsCollection;

typedef Collection PackageCollection;

typedef Collection TimeCollection;

typedef Collection SystemCollection;

typedef Collection StereotypeCollection;

typedef Collection RelationshipCollection;

typedef Collection ConstraintCollection;

typedef Collection DependencyCollection;

typedef string String;

typedef boolean Boolean;

typedef unsigned_longUML_blob;

typedef string Multiplicity;

typedef string Name;

typedef string Expression;

typedefUML_blob Uninterpreted;

enum Visibility {

public, protected, private, implementation

};

struct Point {

unsigned_long x;

unsigned_long y;

unsigned_long z;

};

interface Note: ModelElement {

attribute Uninterpreted value;

attribute Structural_Elements::PatternCollection notes;

};

interface NoteFactory {

Note create();

};

interface TaggedValue: ModelElement {

attribute Uninterpreted value;

attribute String name;

attribute Element characteristic;

attribute TaggedValueCollection tagset;

TaggedValue find_by_name(in Name name);

TaggedValue add_TaggedValue();

void remove_TaggedValue(in TaggedValue theObject);

};

interface TaggedValueFactory {

TaggedValue create();

};

interface ViewElement: Element {

ProjectionCollection get_projection();

ModelElement add_ModelElement();

void remove_ModelElement(in ModelElement theObject);

};

interface ViewElementFactory {

ViewElement create();

};

interface Model: CosStream::Streamable {

attribute Name name;

attribute PackageCollection represents;

attribute System abstraction;

ElementCollection contents();

};

interface ModelFactory {

Model create();

};

interface Element: CosLifeCycle::LifeCycleObject {

attribute TaggedValueCollection characteristic;

attribute Stereotype classification;

Name name;

OwnsCollection get_owns();

ReferencesCollection get_references();

DependencyCollection get_dependency();

TaggedValue find_by_name(in Name name);

TaggedValue add_TaggedValue();

void remove_TaggedValue(in TaggedValue theObject);

Stereotype add_Stereotype();

void remove_Stereotype(in Stereotype theObject);

Name add_Name();

void remove_Name(in Name theObject);

};

interface ElementFactory {

Element create();

};

interface ModelElement: Element {

attribute Structural_Elements::ComponentCollection implements;

ProjectionCollection get_projection();

};

interface ModelElementFactory {

ModelElement create();

};

interface References: CosLifeCycle::LifeCycleObject {

attribute Name alias;

attribute Visibility visibility;

attribute Package Package_reference;

attribute Element Element_reference;

};

interface ReferencesFactory {

References create();

};

interface Owns: CosLifeCycle::LifeCycleObject {

attribute Visibility visibility;

attribute Package Package_reference;

attribute Element Element_reference;

};

interface OwnsFactory {

Owns create();

};

interface Package: ModelElement, Structural_Elements::GeneralizableElement, CosStream::Streamable {

attribute Model represents;

OwnsCollection get_owns();

Element add_Element();

void remove_Element(in Element theObject);

ReferencesCollection get_references();

Element add_Element();

void remove_Element(in Element theObject);

};

interface PackageFactory {

Package create();

};

interface Time: CosLifeCycle::LifeCycleObject {

};

interface TimeFactory {

Time create();

};

interface System: CosStream::Streamable {

attribute Name name;

attribute ModelCollection abstraction;

attribute DependencyCollection trace;

attribute StereotypeCollection define;

Model add_Model();

void remove_Model(in Model theObject);

Dependency add_Dependency();

void remove_Dependency(in Dependency theObject);

Stereotype add_Stereotype();

void remove_Stereotype(in Stereotype theObject);

};

interface SystemFactory {

System create();

};

interface Stereotype: ModelElement, Structural_Elements::GeneralizableElement {

attribute Uninterpreted value;

attribute ElementCollection classification;

attribute System define;

};

interface StereotypeFactory {

Stereotype create();

};

interface Relationship: ModelElement {

attribute Structural_Elements::Class relationship_class;

attribute Structural_Elements::PatternCollection relationships;

};

interface RelationshipFactory {

Relationship create();

};

interface Constraint: ModelElement {

attribute Uninterpreted value;

attribute Structural_Elements::PatternCollection constraints;

 

};

interface ConstraintFactory {

Constraint create();

};

interface Dependency: Relationship {

attribute System trace;

attribute source source_reference;

attribute target target_reference;

};

interface DependencyFactory {

Dependency create();

}; 

};

4.3.3 OAD_Facility 模块

module OAD_Facility {

#include "Core_Concepts.idl"

#include "Structural_Elements.idl"

#include "Behavioral_Elements.idl"

#include "View_Elements.idl"

};

4.3.4 Structural_Elements 模块

#include <CosLifeCycle.idl>

#include <Core_Concepts.idl>

#include <Behavioral_Elements.idl>

// =========================================================

module Structural_Elements {

 

interface AssociationRole;

interface Node;

interface FormalParameter;

interface Method;

interface ActiveClass;

interface Activity;

interface Pattern;

interface Component;

interface Class;

interface Nested;

interface Signal;

interface Parameter;

interface Operation;

interface Instance;

interface Member;

interface Type;

interface UseCase;

interface Attribute;

interface Responsibility;

interface Value;

interface Association;

interface Generalization;

interface Members;

interface GeneralizableElement;

interface PrimitiveType;

interface TypeExpression;

interface Signals;

typedef Collection AssociationRoleCollection;

typedef Collection NodeCollection;

typedef Collection FormalParameterCollection;

typedef Collection MethodCollection;

typedef Collection ActiveClassCollection;

typedef Collection ActivityCollection;

typedef Collection PatternCollection;

typedef Collection ComponentCollection;

typedef Collection ClassCollection;

typedef Collection NestedCollection;

typedef Collection SignalCollection;

typedef Collection ParameterCollection;

typedef Collection OperationCollection;

typedef Collection InstanceCollection;

typedef Collection MemberCollection;

typedef Collection TypeCollection;

typedef Collection UseCaseCollection;

typedef Collection AttributeCollection;

typedef Collection ResponsibilityCollection;

typedef Collection ValueCollection;

typedef Collection AssociationCollection;

typedef Collection GeneralizationCollection;

typedef Collection MembersCollection;

typedef Collection GeneralizableElementCollection;

typedef Collection PrimitiveTypeCollection;

typedef Collection TypeExpressionCollection;

typedef Collection SignalsCollection;

enum Concurrency {

sequential, guarded, synchronous

};

enum Direction {

catch, throw

};

interface AssociationRole: Core_Concepts::ModelElement {

attribute Core_Concepts::Multiplicity multiplicity;

attribute Core_Concepts::Boolean isNavigable;

attribute Core_Concepts::Boolean isAggregate;

attribute Core_Concepts::Boolean isOrdered;

attribute Core_Concepts::Boolean isChangeable;

attribute Type participates;

attribute Association association_roles;

attribute AttributeCollection qualifier;

attribute Type role;

attribute Behavioral_Elements::LinkRoleCollection role_instance;

Attribute add_Attribute();

void remove_Attribute(in Attribute theObject);

Type add_Type();

void remove_Type(in Type theObject);

};

interface AssociationRoleFactory {

AssociationRole create();

};

interface Node: Class {

attribute ComponentCollection deploys;

Component add_Component();

void remove_Component(in Component theObject);

};

interface NodeFactory {

Node create();

};

interface FormalParameter: CosLifeCycle::LifeCycleObject {

attribute {in,_inout,_out,_return} kind;

attribute Operation Operation_reference;

attribute Parameter Parameter_reference;

};

interface FormalParameterFactory {

FormalParameter create();

};

interface Method: Operation {

attribute Core_Concepts::Uninterpreted body;

};

interface MethodFactory {

Method create();

};

interface ActiveClass: Class {

};

interface ActiveClassFactory {

ActiveClass create();

};

interface Activity: Behavioral_Elements::Event {

attribute Behavioral_Elements::ActionCollection activity;

 

};

interface ActivityFactory {

Activity create();

};

interface Pattern: Core_Concepts::ModelElement {

attribute Core_Concepts::Boolean isTemplate;

attribute Core_Concepts::ConstraintCollection constraints;

attribute Core_Concepts::NoteCollection notes;

attribute Core_Concepts::RelationshipCollection relationships;

attribute TypeCollection types;

attribute Behavioral_Elements::BehaviorCollection behaviors;

attribute ValueCollection pattern_argument

attribute ParameterCollection pattern_parameter;

attribute Type represents;

attribute Operation represents;

Constraint add_Constraint();

void remove_Constraint(in Constraint theObject);

Note add_Note();

void remove_Note(in Note theObject);

Relationship add_Relationship();

void remove_Relationship(in Relationship theObject);

Type add_Type();

void remove_Type(in Type theObject);

Behavior add_Behavior();

void remove_Behavior(in Behavior theObject);

Value add_Value();

void remove_Value(in Value theObject);

Parameter add_Parameter();

void remove_Parameter(in Parameter theObject);

};

interface PatternFactory {

Pattern create();

};

interface Component: Class {

attribute NodeCollection deploys;

attribute Core_Concepts::ModelElementCollection implements;

ModelElement add_ModelElement();

void remove_ModelElement(in ModelElement theObject);

};

interface ComponentFactory {

Component create();

};

interface Class: Type {

attribute Core_Concepts::Relationship relationship_class;

 

};

interface ClassFactory {

Class create();

};

interface Nested: CosLifeCycle::LifeCycleObject {

attribute Core_Concepts::Visibility visibility;

attribute Type Type_reference;

};

interface NestedFactory {

Nested create();

};

interface Signal: Class, Activity {

SignalsCollection get_signals();

};

interface SignalFactory {

Signal create();

};

interface Parameter: Core_Concepts::ModelElement {

attribute TypeExpression type;

attribute Core_Concepts::Uninterpreted defaultValue;

attribute Type template_parameter;

attribute Pattern pattern_parameter;

FormalParameterCollection get_formal_parameter();

};

interface ParameterFactory {

Parameter create();

};

interface Operation: Member, Activity {

attribute Core_Concepts::Boolean isPolymorphic;

attribute Concurrency concurrency;

attribute Core_Concepts::Boolean isQuery;

attribute Core_Concepts::Boolean isAbstract;

attribute PatternCollection represents;

FormalParameterCollection get_formal_parameter();

Parameter add_Parameter();

void remove_Parameter(in Parameter theObject);

};

interface OperationFactory {

Operation create();

};

interface Instance: Core_Concepts::ModelElement {

attribute Core_Concepts::Boolean isCreated;

attribute Core_Concepts::Boolean isDestroyed;

attribute Type instance_of;

attribute ValueCollection values;

attribute Behavioral_Elements::State state_instance;

attribute TypeCollection roles;

attribute Behavioral_Elements::Behavior actions;

attribute Behavioral_Elements::Interaction instances;

attribute Behavioral_Elements::Message thread;

attribute Behavioral_Elements::LinkRoleCollection player;

Value add_Value();

void remove_Value(in Value theObject);

State add_State();

void remove_State(in State theObject);

Type add_Type();

void remove_Type(in Type theObject);

Behavior add_Behavior();

void remove_Behavior(in Behavior theObject);

ActualArgumentCollection get_actual_argument();

};

interface InstanceFactory {

Instance create();

};

interface Member: Core_Concepts::ModelElement {

MembersCollection get_members();

};

interface MemberFactory {

Member create();

};

interface Type: Core_Concepts::ModelElement, GeneralizableElement {

attribute Core_Concepts::Boolean isTemplate;

attribute Core_Concepts::Multiplicity multiplicity;

attribute InstanceCollection instance_of;

attribute TypeExpressionCollection references;

attribute AssociationRoleCollection participates;

attribute Generalization powertype;

attribute AssociationRoleCollection role;

attribute ValueCollection template_argument;

attribute ParameterCollection template_parameter;

attribute InstanceCollection roles;

attribute PatternCollection types;

attribute PatternCollection represents;

MembersCollection get_members();

Member add_Member();

void remove_Member(in Member theObject);

SignalsCollection get_signals();

Signal add_Signal();

void remove_Signal(in Signal theObject);

NestedCollection get_nested();

Value add_Value();

void remove_Value(in Value theObject);

Parameter add_Parameter();

void remove_Parameter(in Parameter theObject);

};

interface TypeFactory {

Type create();

};

interface UseCase: Type {

};

interface UseCaseFactory {

UseCase create();

};

interface Attribute: Member {

attribute TypeExpression type;

attribute Core_Concepts::Uninterpreted initialValue;

attribute AssociationRole qualifier;

attribute Behavioral_Elements::State state_variable;

};

interface AttributeFactory {

Attribute create();

};

interface Responsibility: Core_Concepts::TaggedValue {

};

interface ResponsibilityFactory {

Responsibility create();

};

interface Value: Core_Concepts::ModelElement {

attribute Core_Concepts::Uninterpreted value;

attribute Instance values;

attribute Type template_argument;

attribute Pattern pattern_argument;

attribute Behavioral_Elements::LinkRole qualification;

};

interface ValueFactory {

Value create();

};

interface Association: Core_Concepts::Relationship {

attribute sequence<AssociationRole,2> association_roles;

attribute Behavioral_Elements::LinkCollection link_instance;

AssociationRole add_AssociationRole();

void remove_AssociationRole(in AssociationRole theObject);

};

interface AssociationFactory {

Association create();

};

interface Generalization: Core_Concepts::Relationship {

attribute Type powertype;

attribute supertype supertype_reference;

attribute subtype subtype_reference;

Type add_Type();

void remove_Type(in Type theObject);

};

interface GeneralizationFactory {

Generalization create();

};

interface Members: CosLifeCycle::LifeCycleObject {

attribute Core_Concepts::Boolean isTypeScope;

attribute Core_Concepts::Visibility visibility;

attribute {provide,_require} direction;

attribute Type Type_reference;

attribute Member Member_reference;

};

interface MembersFactory {

Members create();

};

interface GeneralizableElement: CosLifeCycle::LifeCycleObject {

attribute Core_Concepts::Boolean isRoot;

attribute Core_Concepts::Boolean isLeaf;

attribute Core_Concepts::Boolean isAbstract;

GeneralizationCollection get_generalization();

};

interface GeneralizableElementFactory {

GeneralizableElement create();

};

interface PrimitiveType: Type {

attribute Core_Concepts::Uninterpreted details;

};

interface PrimitiveTypeFactory {

PrimitiveType create();

};

interface TypeExpression: Core_Concepts::Expression {

attribute TypeCollection references;

TypeCollection referencedTypes();

};

interface TypeExpressionFactory {

TypeExpression create();

};

interface Signals: CosLifeCycle::LifeCycleObject {

attribute Direction direction;

attribute Type Type_reference;

attribute Signal Signal_reference;

};

interface SignalsFactory {

Signals create();

};

};

4.3.5 View_Elements 模块

#include <CosLifeCycle.idl>

#include <CosStream.idl>

#include <Core_Concepts.idl>

// =========================================================

 

module View_Elements {

interface SequenceDiagram;

interface StateDiagram;

interface Projection;

interface DeploymentDiagram;

interface Diagram;

interface CollaborationDiagram;

interface ComponentDiagram;

interface ClassDiagram;

interface ActivityDiagram;

interface UseCaseDiagram;

typedef Collection SequenceDiagramCollection;

typedef Collection StateDiagramCollection;

typedef Collection ProjectionCollection;

typedef Collection DeploymentDiagramCollection;

typedef Collection DiagramCollection;

typedef Collection CollaborationDiagramCollection;

typedef Collection ComponentDiagramCollection;

typedef Collection ClassDiagramCollection;

typedef Collection ActivityDiagramCollection;

typedef Collection UseCaseDiagramCollection;

interface SequenceDiagram: Diagram {

};

interface SequenceDiagramFactory {

SequenceDiagram create();

};

interface StateDiagram: Diagram {

};

interface StateDiagramFactory {

StateDiagram create();

};

interface Projection: CosLifeCycle::LifeCycleObject {

attribute PointCollection placement;

attribute Core_Concepts::Uninterpreted style;

attribute ViewElement ViewElement_reference;

attribute ModelElement ModelElement_reference;

};

interface ProjectionFactory {

Projection create();

};

interface DeploymentDiagram: Diagram {

};

interface DeploymentDiagramFactory {

DeploymentDiagram create();

};

interface Diagram: Core_Concepts::ViewElement, CosStream::Streamable {

};

interface DiagramFactory {

Diagram create();

};

interface CollaborationDiagram: Diagram {

};

interface CollaborationDiagramFactory {

CollaborationDiagram create();

};

interface ComponentDiagram: Diagram {

};

interface ComponentDiagramFactory {

ComponentDiagram create();

};

interface ClassDiagram: Diagram {

};

interface ClassDiagramFactory {

ClassDiagram create();

};

interface ActivityDiagram: Diagram {

};

interface ActivityDiagramFactory {

ActivityDiagram create();

}; 

interface UseCaseDiagram: Diagram {

};

interface UseCaseDiagramFactory {

UseCaseDiagram create();

};

};

 


版权所有:UML软件工程组织