Association Classes of UML
来源:互联网 发布:淘宝闲鱼客户端 编辑:程序博客网 时间:2024/05/17 23:41
Association Classes
- Association classes allow you to add attributes, operations, and other features to associations, as shown in attached file (Association Classes.jpg). We can see from the diagram that a person may attend many meetings. We need to keep information about how awake that person was; we can do this by adding the attribute attentiveness to the association.
- Attached file (Association Classes02.jpg) shows another way to represent this information: Make Attendance a full class in its own right. Note how the multiplicities have moved.
- What benefit do you gain with the association class to offset the extra notation you have to remember? The association class adds an extra constraint, in that there can be only one instance of the association class between any two participating objects.
- Implementing association classes isn't terribly obvious. My advice is to implement an association class as if it where a full class but to provide methods that get information to the classes linked by the association class. So for Figure 5.12 (Association Classes.jpg), I would see the following methods on Person:
class Person
List getAttendances(String meeting)
List getMeetings()
- This way, a client of Person can get hold of the people at the meeting; if they want details, they can get the Attendances themselves. If you do this, remember to enforce the constraint that there can be only one Attendance object for any pair of Person and Meeting. You should place a check in whichever method creates the Attendance.
The information get from UML Distilled.
Summary: association classes is likely make which as a full class, but to provide methods that get information to the classes linked by the association class.
- Association Classes of UML
- UML-Combination, Association, Generalization
- An Example of association query
- UML Dependency Association Aggregation Composition Generalization Realization
- Hierarchy of Classes
- Classes of Wait Events
- Overview of UIKit Classes
- Overview of UIKit Classes
- The Primer of Classes
- Association
- The Six Types of Rails Association
- A set of ADO classes
- Introduction of OpenCascade Foundation Classes
- UML中关联(Association)和依赖(Dependency)的区别
- UML的关联(Association), 聚合(Aggregation), 组合(Composition)区别
- UML中关联(Association)和依赖(Dependency)的区别
- [UML]1-Overview of UML
- UVALive - 7484 Association for the Country of Mububa(dp)
- 《贫民富翁》获奥斯卡八奖 温斯莱特封后
- TVSKIN源代码阅读日记(四)--- 图片解析和相关类
- VCKBase上的文章:Microsoft CryptoAPI加密技术
- Java中String.split()用法的一点经验
- TVSKIN源代码阅读日记(五)--- CFONT CLASS (MFC LIB) & LOGFONT STRUCT(GDI)
- Association Classes of UML
- 对象函数的指针
- 这是判断日期是否合法的程序。相信有助于你。
- 项目管理--激发团队创造的热情
- 纸牌显示的方向
- 经典短小代码收集
- java操作excel杂谈及jxls初体验
- ubuntu使用终端设置网络
- TVSKIN源代码阅读日记(八)--- ReadLayerData