第七章 构件图

目录

m 1.体系结构建模概述
m 2.构件
m 3.制品
m 4. 协作
m 5. 构件图
m 6. 制品图

1. 体系结构建模概述

m 系统体系结构分为
Ø 软件体系结构
Ø 硬件体系结构
m 体系结构建模
Ø 软件体系结构对系统的用例、类、对象、接口以及相互间的交互和协作进行描述。
Ø 硬件体系结构对系统构件、节点的配置进行描述。

m 软件系统体系结构模型是系统的逻辑体系结构模型。系统的复杂功能由不同的模型元素及关系来表达,并使用包机制进行组织与管理。
m 软件系统体系结构模型的作用:
Ø 指出系统应该具有的功能;
Ø 为完成这些功能,涉及到哪些类,这些类之间如何相互联系;
Ø 类和它们的对象如何协作才能实现这些功能;
Ø 指明系统中各功能实现的先后时间顺序;
Ø 根据此模型,制定出相应的开发进度计划。
m 硬件系统体系结构模型给出系统硬件结构,即节点构成及其关系,和代码模块的物理结构和依赖关系,并展示进程、程序等软件在运行时的物理分配。
m 硬件系统体系结构模型的作用:
Ø 指出系统中的类和对象涉及的具体程序或进程;
Ø 标明系统中配置的计算机和其他硬件设备;
Ø 指明各种计算机和硬件设备如何进行相互连接;
Ø 明确不同的代码文件之间相互的依赖关系;
Ø 如果修改某个代码文件,标明哪些相关(与之有依赖关系)的代码文件需要重新进行编译。

2. 构件(componet

m 表示封装了内容的系统模块,它在其环境中的表现形式可以被替代。
m 使用构件的意图是为了强调
Ø 接口是重要的
Ø 构件是相对独立和可替换的

m 端口( port

    A port is an explicit window into anencapsulated component.

m 部件( Part

    A part is a unit of the implementation of acomponent

m 连接件( Connector

     A connector is a communicationrelationship between two parts or ports within the context of a component

m 构件和接口

    An interface is a collection of operationsthat are used to specify a service of a class or a component. The relationshipbetween component and interface is important. All the most commoncomponent-based operating system facilities (such as COM+, CORBA, andEnterprise Java Beans) use interfaces as the glue that binds componentstogether.

3. 制品(artifact

m 软件开发过程中产生或使用的信息的物理部分的规约。可以是模型、描述或软件。
m 与类的区别
Ø 类表示逻辑抽象,制品表示物理抽象
Ø 类可以拥有属性和操作,制品没有属性和操作,但可以实现类和方法
m 联系:制品是一组逻辑元素的物理实现

m 制品的种类:
Ø 部署制品( deployment  artifact
Ø 工作产品制品( work product artifact
Ø 执行制品( execution artifact
m UML 预定义的标准构造型
Ø executable
Ø library
Ø file
Ø document

4.协作

    In the context of a systems architecture, acollaboration allows you to name a conceptual chunk that encompasses bothstatic and dynamic aspects. A collaboration names a society of classes,interfaces, and other elements that work together to provide some cooperativebehavior that's bigger than the sum of all its parts.

   A quality software-intensive system is not only functionally sound, but it alsoexhibits a harmony and balance of design that makes it resilient to change.


m Structure
m Collaborations have two aspects: a structural part that specifies theclasses, interfaces, and other elements that work together to carry out thenamed collaboration; and a behavioral part that specifies the dynamics of howthose elements interact.


Behavior
Whereas the structural part of a collaboration is typically renderedusing a composite structure diagram, the behavioral part of a collaboration istypically rendered using an interaction diagram. An interaction diagramspecifies an interaction that represents a behavior comprised of a set ofmessages that are exchanged among a set of objects within a context toaccomplish a specific purpose. An interaction's context is provided by itsenclosing collaboration, which establishes the classes, interfaces, components,nodes, and other structural elements whose instances may participate in thatinteraction.

Common Modeling Techniques
Modeling Roles

Ø Modeling the Realization of a Use Case

Ø Modeling the Realization of an Operation

Ø Modeling a Mechanism

Mechanisms are collaborations that standalone; their context is not a single use case or an operation but, rather, thesystem as a whole. Any element visible in that part of the system is acandidate for participation in a mechanism.

5. 构件图(component  diagram

m 显示构件的定义、内部结构以及相互依赖关系的模型图。



6. 制品图

m 制品图( artifact diagram : 显示制品以及它们关系的模型图。

m 制品图包括:
Ø 制品
Ø 依赖、泛化、关联和实现关系
Ø 注解和约束
m 一般用法
Ø 对源代码建模
Ø 对可执行程序的发布建模
Ø 对物理数据库建模
Ø 对可适应系统建模



小结

m 体系结构是指系统由哪些部分组成和它们之间的相互关系,以及在运行时的空间拓扑关系。
m 软件体系结构用构件图描述。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值