UML2.51边译边学-部署图

面向对象思考

共 9919字,需浏览 20分钟

 ·

2021-10-12 21:55


本文是UML规范2.5.1中部署图相关部分中文翻译。原文可从https://www.omg.org/spec/UML/2.5.1下载。


19.1 Summary(总结)

The Deployments package specifies constructs that can be used to define the execution architecture of systems and the assignment of software artifacts to system elements. A streamlined model of deployment, sufficient for the majority of modern applications, is provided. Where more elaborate deployment models are required, the package can be extended through profiles or metamodels to represent specific hardware and/or software environments. 

部署包指定了可用于定义系统执行架构和软件模块如何分配到系统要素。它提供了一个足以满足大多数现代应用需要的精简的部署模型。在需要更复杂的部署模型的地方,可以通过配置文件或元模型扩展部署包以表示特定的硬件和/或软件环境。


19.2 Deployments(部署关系)

19.2.1 Summary(总结)

Deployments capture relationships between logical and/or physical elements of systems and information technology assets assigned to them.

部署关系用于表现系统的逻辑和/或物理元素与分配给它们的信息技术制品之间的关系。


19.2.3 Semantics(语义)

A Deployment captures the relationship between a particular conceptual or physical element of a modeled system and the information assets assigned to it. System elements are represented as DeployedTargets, and information assets, as DeployedArtifacts. DeploymentTargets and DeploymentArtifacts are abstract classes that cannot be directly instantiated. They are, however, elaborated as concrete classes as described in the Artifacts and Nodes sub clauses that follow.

部署关系表现建模对象系统的特定概念或物理元素与分配给它的信息资产之间的关系。系统元素表示为部署对象,信息资产表示为被部署制品。部署对象和被部署制品是不能直接实例化的抽象类。然而,它们被详细阐述为具体类,如随后的工件和节点子条款中所述。

Individual Deployment relationships can be tailored for specific uses by adding DeploymentSpecifications containing configurational and/or parametric information and may be extended in specific component profiles. For example, standard, non-normative stereotypes that a profile might add to DeploymentSpecification include «concurrencyMode», with tagged values {thread, process, none}, and «transactionMode», with tagged values {transaction,

nestedTransaction, none}.

可以通过添加包含配置和/或参数信息的部署定义来针对特定用途定制各个部署关系,并且可以在特定组件配置文件中进行扩展。例如,配置文件可能添加到 部署定义的标准、非规范构造型包括 «并发模式»,带有标记值 {线程,进程,无} 和 «事务模式»,带有标记值 {事务, 嵌套事务,无}。

The Deployment relationship between a DeployedArtifact and a DeploymentTarget can be defined at the “type” level and at the “instance” level. At the “type” level, the Deployment connects kinds of DeploymentTargets to kinds of DeployedArtifacts. Whereas, at the “instance” level, the Deployment connects particular DeploymentTargets instances to particular DeployedArtifacts instances. For example, a ”type” level Deployment might connect an “applicationserver” with an “order entry request handler.” In contrast, at the ”instance” level, three specific application services (say, “app-server1”, “app-server-2” and “app-server3”) may be the DeploymentTargets for six different “request handler” instances.

被部署制品和部署对象之间的部署关系可以按照“类型”或“实例”观点进行定义。 按照“类型”观点,部署关系将各种部署对象连接到各种被部署制品。而按照“实例”观点,部署将特定的部署对象实例连接到特定的被部署制品实例。例如,“类型”观点的部署可能会将“应用程序服务器”与“订单输入请求处理程序”连接起来。相比之下,按照“实例”观点,三个特定的应用程序服务(例如,“app-server1”、“app-server-2”和“app-server3”)可能是六个不同“请求处理程序”实例的部署对象。

For modeling complex models consisting of composite structures, a Property, functioning as a part (i.e., owned by a composition), may be the target of a Deployment. Likewise, InstanceSpecifications can be DeploymentTargets in a Deployment relationship, if they represent a Node that functions as a part within an encompassing Node composition hierarchy, or if they represent an Artifact.

对于由复合结构组成的复杂模型的建模,属性作为一个部分(即由组合拥有)可能成为部署的目标。同样,实例定义可以是部署关系中的部署对象,如果它们代表一个节点作为包含节点的组合层次结构中的一部分,或者如果它们代表一个制品。

译者注:下面的例子可以看作是通过配置文件控制制品行为的画法实例。


19.3 Artifacts(制品)

19.3.1 Summary(总结)

An Artifact represents some (usually reifiable) item of information that is used or produced by a software development process or by operation of a system. Examples of Artifacts include model files, source files, scripts, executable files, database tables, development deliverables, word-processing documents, and mail messages.

制品表示由软件开发过程或系统操作使用或产生的一些(通常是可具体化的)信息项。 制品的示例包括模型文件、源文件、脚本、可执行文件、数据库表、开发可交付成果、文字处理文档和邮件消息。


19.3.3 Semantics(语义)

Artifacts elaborate and reify the abstract notion of DeployedArtifact. They represent concrete elements in the physical world, may have Properties representing their features and Operations that can be performed their instances, and may be multiply-instantiated so that different instances may be deployed to various DeploymentTargets, each with separate property values.

制品详细阐述并具体化了被部署制品的抽象概念。它们代表物理世界中的具体元素,可以具有代表它们的特性和可以在它们的实例中执行的操作,并且可以被多重实例化,以便不同的实例可以部署到不同的部署目标,每个具有单独的属性值。

More complex Artifacts can be created by organizing them into composition hierarchies. In this way, a DeploymentSpecification for a component may be contained within an Artifact, allowing a component and its parameters to be deployed as a single Artifact instance.

可以通过将制品组织成组合层次结构来创建更复杂的制品。通过这种方式,组件的部署定义可以包含在工件中,从而允许将组件及其参数部署为单个组件实例。

Artifacts may be extended to better represent the needs of specific information items. For example, profiles may extend Artifact to model sets of files. UML defines several standard stereotypes for Artifacts, including «source» and «executable», that may be further specialized as needed. For example, an EJB profile might define «jar» as a subclass of «executable» for executable Java archives.

可以扩展制品以更好地表示特定信息项的需求。例如,配置文件可以将制品扩展到模型文件集。UML 为制品定义了几个标准构造型,包括 «source» 和 «executable»,可以根据需要进一步专门化。例如,EJB 配置文件可能将 «jar» 定义为可执行 Java 存档的 «executable» 的子类。

An Artifact may embody, or manifest, a number of model elements. The Artifact owns the Manifestations, each representing the utilization of some PackageableElement. Profiles may extend the Manifestation relationship to indicate particular forms of embodiment. For example, «tool generated» and «custom code» might be two Manifestations for

different Classes embodied in an Artifact.

制品可能包含或体现多个模型元素。 制品拥有若干表现定义,每个表现定义代表某些包元素的利用率。配置文件可以扩展表现关系以指示特定形式的实施例。例如,«工具生成» 和 «自定义代码» 可能是两个不同的类体现在一个制品中时的表现定义。



19.4 Nodes(节点)

19.4.1 Summary(总结)

Nodes elaborate and reify the abstract notion of DeploymentTargets. They can be nested and can be connected into systems of arbitrary complexity using communication paths. Typically, Nodes represent either hardware devices or software execution environments.

节点详细阐述并具体化了部署对象的抽象概念。它们可以嵌套并且可以使用通信路径连接到任意复杂的系统中。通常,节点代表硬件设备或软件执行环境。

19.4.3 Semantics(语义)

A Node is computational resource upon which Artifacts may be deployed, via Deployment relationships, for execution. For advanced modeling applications, Nodes may have complex internal structure defined by nesting and may be interconnected to represent specific situations. The internal structure of Nodes can only consist of other Nodes. Besides participating in Deployments, Nodes acquire a set of associated elements derived from the Manifestation relationships of the Artifacts deployed on them.

节点是计算资源,可以通过部署关系在其上部署制品以供执行。对于高级建模应用程序,节点可能具有由嵌套定义的复杂内部结构,并且可以互连以表示特定情况。 节点的内部结构只能由其他节点组成。除了参与部署之外,节点还需要一组关联元素,这些元素源自部署在其上的制品的表现关系。

Nodes may be further sub-typed as Devices and ExecutionEnvironments. Devices represent physical machine components. ExecutionEnvironments represent standard software systems that application components may require at execution time. Specific profiles might, for example, define stereotypes for ExecutionEnvironments such as «OS», «workflow engine», «database system», and «J2EE container».

节点可以进一步细分为设备和执行环境。设备代表物理机器组件。 执行表示应用程序组件在执行时可能需要的标准软件系统。例如,特定的配置文件可能会定义执行环境的构造型,例如《OS》、《工作流引擎》、《数据库系统》和《J2EE 容器》。

A Device is a physical computational resource with processing capability upon which Artifacts may be deployed for execution. Devices may be complex (i.e., they may consist of other devices) either through namespace ownership or through attributes that are themselves typed by Devices. Entire physical computing systems may be decomposed into their constituents in this way. Examples of Devices might include «application server», «client workstation», «mobile device», and «embedded device».

设备是具有处理能力的物理计算资源,可以在其上部署制品以执行。设备可能很复杂(即,它们可能由其他设备组成),或者通过名称空间所有权或通过设备本身定义的属性。整个物理计算系统可以通过这种方式分解成它们的组成部分。设备的示例可能包括《应用服务器》、《客户端工作站》、《移动设备》和《嵌入式设备》。

Typically, ExecutionEnvironments are assigned to some, often higher level, Device or general system Node via the composition relationship defined on Node. ExecutionEnvironments can be nested (for example, a database ExecutionEnvironment might be nested in an operating system ExecutionEnvironment). ExecutionEnvironment may have explicit interfaces for system level services that can be called by the deployed elements. In such cases, software ExecutionEnvironment services should be explicitly modeled. Application Components of the appropriate type are then deployed, with a Deployment relationship, to specific ExecutionEnvironment nodes or the Manifestations relationships of DeployedArtifacts. For each component Deployment, aspects of these services may be determined by properties in a

DeploymentSpecification for a particular kind of ExecutionEnvironment.

通常,执行环境通过 Node.js 上定义的组合关系分配给一些通常更高级别的设备或通用系统节点。 执行环境可以嵌套(例如,数据库执行环境可能嵌套在操作系统执行环境中)。执行环境可能具有系统级服务的显式接口,可以由部署的元素调用。在这种情况下,应该对软件执行环境服务进行显式建模。然后将具有部署关系的适当类型的应用程序组件部署到特定的节执行环境节点或 被部署制品的表现关系。对于每个组件部署,这些服务的方面可能由

特定类型的执行环境的部署定义。

Nodes can be connected to represent specific network topologies using CommunicationPaths defining specific connections between Node instances. A CommunicationPath is an Association between two DeploymentTargets, through which they may exchange Signals and Messages.

可以使用定义节点实例之间的特定连接的通信路径来连接节点以表示特定的网络拓扑。 通信路径是两个部署对象之间的关联,通过它它们可以交换信号和消息。

作者著作介绍

《实战Python设计模式》是作者去年3月份出版的技术书籍,该书利用Python 的标准GUI 工具包tkinter,通过可执行的示例对23 个设计模式逐个进行说明。这样一方面可以使读者了解真实的软件开发工作中每个设计模式的运用场景和想要解决的问题;另一方面通过对这些问题的解决过程进行说明,让读者明白在编写代码时如何判断使用设计模式的利弊,并合理运用设计模式。

对设计模式感兴趣而且希望随学随用的读者通过本书可以快速跨越从理解到运用的门槛;希望学习Python GUI 编程的读者可以将本书中的示例作为设计和开发的参考;使用Python 语言进行图像分析、数据处理工作的读者可以直接以本书中的示例为基础,迅速构建自己的系统架构。




觉得本文有帮助?请分享给更多人。

关注微信公众号【面向对象思考】轻松学习每一天!

面向对象开发,面向对象思考!




浏览 36
点赞
评论
收藏
分享

手机扫一扫分享

分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

分享
举报