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

  1. 1、本文档共8页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
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 (only a subset of these attributes and operations are likely to be relevant to a specific view). For these reasons, you can elide a class, meaning that you can choose to show only some or none of a class’s attributes and operations. You can indicate that there are more attributes or properties than shown by ending each list with an ellipsis (“...”). You can also suppress the compartment entirely, in which case you can’t tell if there are any attributes or operations or how many there are. 在你画类的时候,不需要同时显示每个属性和每个操作.事实上,大多数情况下,你不能(有太多要放到一个图里) 也不想(只有一部分属性和操作似乎与指定的视图相关)这么做.由于这个原因,你可以省略一个类,这意味着你可以选择不显示或只显示类的部分属性或操作.你可以在列表末尾用一个省略号指示出更多的属性或操作.在说不清是否有属性或操作,也不知道它们有多少个的这种情况下.你也可以完全限制分隔栏. To better organize long lists of attributes and operations, you can also prefix each group with a descriptive category by using stereotypes, as shown in Figure 4-7. 比组织一长串的属性和操作列表更好的方法是,你可以通过使用模式化为每一个描述性的类别组加前缀,如图4-7显示的那样. Responsibilities 职责 A responsibility is a contract or an obligation of a class. When you create a class, you are making a statement that all objects of that class have the same kind of state and the same kind of behavior. At a more abstract level, these corresponding attributes and operations are just the features by which the class’s responsibilities are carried out. A Wall class is responsible for knowing about height, width, and thickness; a FraudAgent class, as you might find in a credit card application, is responsible for processing orders and determining if they are legitimate, suspect, or fraudulent; a TemperatureSensor class is responsible for measuring temperature and raising an alarm if the temperature reaches a certain point. 职责是一个类的契约或是义务.当你创建一个类时,你正在声明类的所有对象所拥有的一种状态和一种行为.在更抽象的层面里,类的职责被执行后显示出来的特征就是所对应的属性和操作.一个墙类的职责目的是了解

文档评论(0)

2017ll + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档