Sometimes you just have to color outside the lines. For example, at a job site, an architect might scribble a few notes on the building’s
blueprints to communicate a subtle detail to the construction workers. In a recording studio, a composer might invent a new musical notation to represent some unusual effect she wants from a guitarist. In both cases, there already exist well-defined languages------the
language of structural blueprints and the language of musical notation------but sometimes you have to bend or extend those languages in controlled ways to communicate your intent.
有时你不得不在线外着色.例如,在工作现场,一位设计师可能随意的在建筑蓝图上写下备注与建筑工人沟通轻微的细节.在录音室里,作曲家可能创造一个新的音乐符号,以达到让吉他手表达一些不是很常见的效果.在这两个案例中,已经存在具有良好定义的语言--结构蓝图的语言和音乐符号的语言--但有时你不得不在已控的方式内缩减或延伸那些语言来传达你的意图.
Modeling is all about communication. The UML already gives you all the tools you need to visualize, specify, construct, and document the artifacts of a wide range of software-intensive
systems. However, you might find circumstances in which you’ll want to bend or extend the UML. This happens
to human languages all the time (that’s why new dictionaries get published every year), because no static language
can ever be sufficient to cover everything you’ll want to communicate for all time. When using a modeling language
such as the UML, remember that you are doing so to communicate, and that means you’ll want to stick to the core
language unless there’s compelling reason to deviate. When you find yourself needing to color outside the lines,
you should do so only in controlled ways. Otherwise, you will make it impossible for anyone to understand what you’ve
done.
建模都是关于沟通的.UML已经给你所有工具为你可视化,详述化,结构化和文档化一个宽泛的集成型系统的产品提供帮助.然而,你可能发现你会想缩减或延伸UML.这在人类语言中总是发生(这就是为什么每年都有新的字典发行的原因),因为没有静态的语言能足以涵盖你任何时候想要传达的事情.当使用像UML这些的建模语言时,记住,你所做的沟通意味着你要坚持语言的核心部分,偏离其核心除非有令人信服的理由.当你发现你自己需要要线条以外着色,你应确保在已控的方式内这么做,否则,你将不能让任何人理解你想要做什么.
Notes are the mechanism provided by the UML to let you capture arbitrary comments and constraints to help illuminate the models you’ve
created. Notes may represent artifacts that play an important role in the software development life cycle, such as requirements, or they may simply represent free-form observations, reviews, or explanations.
备注是UML提供给你随心所欲的注解和约束以帮助你阐明你所创建模型的机制.备注可以表达在软件开发周期内起重要作用的产品,如需求,也可以很简单的表达自由形态的资料,回顾或是解释.
The UML provides a graphical representation for comments and constraints, called a note, as Figure 6-1 shows. This notation permits you to visualize a comment directly. In conjunction
with the proper tools, notes also give you a placeholder to link to or embed other documents.
UML为注解和约束提供被称为备注的图形化的表达方式,如图6-1显示的.这个符号允许你直接地可视化一个注解.与适当的工具结合,备注还可以给你一个链接的点位符或是嵌入其它的文档.
Stereotypes, tagged values, and constraints are the mechanisms provided by the UML to let you add new building blocks, create new properties, and specify new semantics. For example,
if you are modeling a network, you might want to have symbols for routers and hubs; you can use stereotyped nodes to make these things appear as primitive building blocks. Similarly, if you are part of your project’s
release team, responsible for assembling, testing, and then deploying releases, you might want to keep track of the version number and test results for each major subsystem. You can use tagged values to add this information to your models. Finally, if you
are modeling hard real time systems, you might want to adorn your models with information about time budgets and deadlines; you can use constraints to capture timing requirements.
模式化,标签值和约束是UML提供给你增加新构建块,创建新属性和描述新语义的机制.例如,如果你正在为网络建模,你可能想路由器和集线器要有个符号;你可以使用模式化节点来使得这些事物作为原始的构建块出现.同样的,如果你是项目发布团队的一部分,职责是集成,测试和部署发布版本,你可能会想跟踪版本号和为各主要子系统测试结果.你可以使用标签值为你的模型增加信息.最后,如果你在建模的是实时系统,你可能会想使用时间预算和限制信息来修饰你的模型,你可以使用约束捕获时间需求.
The UML provides a textual representation for stereotypes, tagged values, and constraints, as Figure 6-2 shows. Stereotypes also let you introduce new graphical symbols so that you
can provide visual cues to your models that speak the language of your domain and your development culture.
UML为模式化,标签值和约束提供的是文本化的表达方式.如图6-2所显示的.模式化也能让你引进新的图形化符号,以便你能为你的模型提供可视化信息,这样就可以说你领域的语言和使用你的开发习惯.