今天看association class怎么看好像都不是很明白。
摘自UML2.0 in a Nutshell
2.6.6. Association Classes
Often the relationship between two elements isn't a simple structural connection. For example, a football player may be associated with a league by virtue of being on a team. If the association between two elements is complex, you can represent the connection using an association class. An association class is an association that has a name and attributes, like a normal class. You show an association class like a regular class with a dashed line connecting it to the association it represents. Figure 2-29 shows a football player's relationships to a league.
Figure 2-29. Example association class
When translated into code, relationships with association classes often result in three classes: one for each end of the association and one for the association class itself. There may or may not be a direct link between the association ends; the implementation may require you to traverse through the association class to get to the opposite end of the link. In other words, FootballPlayer may not have a direct reference to FootballLeague but may have a reference to FootballTeam instead. FootballTeam would then have a reference to FootballLeague. How the relationships are constructed is a matter of implementation choices; however, the fundamental concept of an association class is unchanged.
按照我的理解以上例子其实看成是FootballPlayer和FootballTeam的Aggregation relationship和FootballTeam和FootballLeague的Aggregation relationship.只不过用Association Classes可以更好的表达FootballPlayer和FootballLeague的间接关系。但这两种表达方法最后的代码表达应该都是一样的。
[代码表现](我认为)
但用together生成的代码和我的想法又不一样
[代码表现](together generation)