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



Modeling New Properties

新特性建模

The basic properties of the UML’s
building blocks-----attributes and operations for classes, the contents of packages, and so on----are generic enough to address most of the things you’ll
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 there’s
not already a way to express what you want by using basic UML.

lIf you’re
convinced there’s 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 project’s
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 subsystem’s
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 as
version and
status 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.

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

时间: 2024-08-26 01:30:31

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

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

 Modeling Comments 注释建模 The most common purpose for which you'll use notes is to write down free-form observations, reviews, or explanations. By putting these comments directly in your models, your models can become a common repository for all the

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

 Modeling New Semantics 新语义建模 When you create a model using UML, you work within the rules the UML lays down. That's a good thing, because it means that you can communicate your intent without ambiguity to anyone else who knows how to read the UML.

UML基本架构建模--通用机制的术语和概念(二)

 Notes 备注 A note that renders a comment has no semantic impact, meaning that its contents do not alter the meaning of the model to which it is attached. This is why notes are used to specify things like requirements, observations, reviews, and expl

UML基本架构建模--通用机制概述

 Common Mechanisms 通用机制 The UML is made simpler by the presence of four common mechanisms that apply throughout the language: specifications, adornments, common divisions, and extensibility mechanisms. This chapter explains the use of two of these

UML基本架构建模--图的通用建模技术(一)

 Modeling Different Views of a System 建模系统的不同视图 When you model a system from different views, you are in effect constructing your system simultaneously from multiple dimensions. By choosing the right set of views, you set up a process that forces y

UML基本架构建模--关联的通用建模技术(三)

 Modeling Structural Relationships 建模结构关系 When you model with dependencies or generalization relationships, you may be modeling classes that represent different levels of importance or different levels of abstraction. Given a dependency between two

UML的通用机制(三)

 Common Divisions In modeling object-oriented systems, the world often gets divided in several ways. First, there is the division of class and object. A class is an abstraction; an object is one concrete manifestation of that abstraction. In the UM

UML基本架构建模--获取类

 Getting Started 开始 Modeling a system involves identifying the things that are important to your particular view. These things form the vocabulary of the system you are modeling. For example, if you are building a house, things like walls, doors, w

UML基本架构建模--类的辅助信息

 Organizing Attributes and Operations 组织属性和操作 When drawing a class, you don't have to show every attribute and every operation at once. In fact, in most cases, you can't (there are too many of them to put in one figure) and you probably should not