UML基本架构建模--通用机制的通用建模技术(二)

来源:互联网 发布:js控制标签隐藏 编辑:程序博客网 时间:2024/04/28 15:56


Modeling New Properties

新特性建模

 

The basic properties of the UMLs building blocks-----attributes and operations for classes, the contents of packages, and so on----are generic enough to address most of the things youll want to model. However, if you want to extend the properties of these basic building blocks, you need to define stereotypes and tagged values.

UML构建模块的基本特性--类属性和操作,包的内容等等--一般足以解决你想建模的大部分东西.然而,如果你想扩展这些基本构建模块的特性,你需要定义版式和标签值.

 

To model new properties,

lFirst, make sure theres not already a way to express what you want by using basic UML.

lIf youre convinced theres no other way to express these semantics, define a stereotype and add the new properties to the stereotype. The rules of generalization apply----tagged values defined for one kind of stereotype apply to its children.

 

 为特性建模,

l首先,确保使用基本的UML没有已存在的方法表达你的想法.

l如果你确信没有其他的方式来表达这些语义,就可以定义版式和增加新的特性到这个版式中.泛化规则的应用--为一种版式定义标签值并应用到它的子类中.

 

For example, suppose you want to tie the models you create to your projects configuration management system. Among other things, this means keeping track of the version number, current check in/check out status, and perhaps even the creation and modification dates of each subsystem. Because this is process-specific information, it is not a basic part of the UML, although you can add this information as tagged values. Furthermore, this information is not just a class attribute either. A subsystems version number is part of its meta-data, not part of the model.

比如,假设你想将你创建的模型连到你的项目配置管理系统中,除了别的之外,这意味着要保留可跟踪的版本号当前登入/登出状态﹑甚至每个子系统的创建和修改日期.因为这是具体过程的信息,它不是UML的基本部分,尽管你可以通过加标签值来保留这些信息.此外,这些信息并不是是一个类的属性.一个子系统的版本号是它的元数据的一部分,而不是这个模型的一部分.

 

Figure 6-10 shows three subsystems, each of which has been extended with the«versioned» stereotype to include its version number and status.

如图6-10显示的三个子系统,它们每一个都带有«版本»版式,这个版式包含它们的版本号和状态.

 

Note: The values of tags such asversion andstatus are things that can be set by tools. Rather than setting these values in your model by hand, you can use a development environment that integrates your configuration management tools with your modeling tools to maintain these values for you.

备注:版本状态这些事物的标签值可以通过工具设置.与其在你的模型中手动设置这些值,倒不如使用一个 整合有你的建模工具和配置管理工具的开发环境为你保留这些值.

 

 
0 0
原创粉丝点击