【发布时间】:2012-12-07 12:14:37
【问题描述】:
我正在尝试使用 eclipse OCL 实现在 OCL 中导航 UML 关联。我知道 UML Associations 被视为 Attributes,并且在 Class 上调用的 getAttributes() 函数将返回一个集合,其中包含 Attributes 以及每个 Property 对象的 Association。但是,我需要的不是Property,而是Association 另一端的Class。
对于双向Associations,下面的代码可以工作,虽然看起来不是很优雅:
self.getAllAttributes().opposite.class
它不仅不优雅,而且在定向Associations 上也不起作用(那里没有对面的Property)。在 OCL 中导航 Associations 是否有更好的方法?
【问题讨论】:
标签: eclipse uml ocl eclipse-mdt