UML_Lec03_类_关系.pptVIP

  • 5
  • 0
  • 约1.4万字
  • 约 44页
  • 2016-11-24 发布于浙江
  • 举报
* UML Lecture, Author: NK Jiang */46 导航性 Navigability Navigability is shown by an arrowhead on the end of the relationship. If a relationship has no arrowhead, then it is bidirectional. Navigability indicates that you can traverse the relationship in the direction of the arrow; May also be able to traverse back the other way, but it will be computationally expensive to do so. Order Product navigable Not navigable navigability * UML Lecture, Author: NK Jiang */46 关联类 Association Class Problem: some attributes are not easily be accommodated in either of the classes with many-to-many relationship. Example: Each Person has a salary with each Company Each Company employs many persons with different salary Can not make the Person salary an attribute of the Person class. Because each Person instance may work for many companies and may have a different salary with each Company. Can not make the Person salary an attribute of Company, because each Company instance employs many Persons all with potentially different salaries. Company Person * * Solution: use “Association Class” * UML Lecture, Author: NK Jiang */46 Association class is an association that is also a class, and consists of the class, association and the dashed line. It may have attributes, operations and relationships You can use an association class when there is exactly one unique link between any pair of objects at any point in time If a pair of objects may have many links to each other at a given point in time, then you reify the relationship by replacing it with a normal class. Company Person Job salary: Double 关联类 Association Class * UML Lecture, Author: NK Jiang */46 关系建模 为简单依赖建模 两个类之间的连接,其中的一个类使用另一个类作为它的操作参数 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 i

文档评论(0)

1亿VIP精品文档

相关文档