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


 

Modeling Simple Dependencies

建模简单的依赖

 

A common kind of dependency relationship is the connection between a class that uses another class as a parameter to an operation.

To model this using relationship,

lCreate a dependency pointing from the class with the operation to the class used as a parameter in the operation.

普通的依赖关系是一个类与另一个被它作为自身参数的类之间的连接.

建模这个使用的关系,

l创建一个依赖,从带有操作的类指向在操作中被作为参数的类.

 

For example, Figure 5-9 shows a set of classes drawn from a system that manages the assignment of students and instructors to courses in a university. This figure shows a dependency from CourseSchedule to Course , because Course is used in both the add and remove operations of CourseSchedule  .例如,在图5-9中显示的一组类,它们来自在大学里分配学生和老师课程的管理系统.这个图显示出一个从课程表课程的依赖,因为课程课程表中的新增移除两个操作中都被使用到.

 

If you provide the full signature of the operation as in this figure, you dont normally need to show the dependency as well, because the use of the class is already explicit in the signature. However, youll want to show this dependency sometimes, especially if youve elided operation signatures or if your model shows other relationships to the used class.

如果你在这个图中规定了此操作的所有特征,通常不需要显示这个依赖,因为类的使用特征已经很清晰.然而,你有时会想显示这个依赖,尤其是如果你已经删除了操作的特征或是如果你的模型显示其它关系所使用的类.

.

This figure shows one other dependency, this one not involving classes in operations but rather modeling a common C++ idiom. The dependency from Iterator shows that the Iterator uses the CourseSchedule ; the CourseSchedule knows nothing about the Iterator . The dependency is marked with the stereotype <permit>, which is similar to the friend statement in C++.

这个图还显示了另一个依赖,类的操作没有涉及这个依赖,这是C++建模的常用习惯.这个依赖来自迭代器,表述的是迭代器使用课程表课程表迭代器一无所知.这个依赖被模式化<许可>所标记,这类似于C++里的友元声明.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值