OCL:在箭头方向导航单向关联

OCL: navigating unidirectional associations against the arrowhead direction

我在这里读到 https://wiki.eclipse.org/OCL/FAQ

How do I access unnavigable opposites in Ecore

In UML, an association that is intended only to be navigated in one direction at run-time may be drawn with a unidirectional arrow.

OCL evaluation occurs at analysis-time and may navigate in both directions regardless of the arrows.

这部分是 OCL 标准还是只是 eclipse ecore 的东西?

一个例子:给定两个 classes A 和 B,以及从 A 到 B(但不是从 B 到 A)的单向关联。在 class 图表中,这可以用从 A 到 B 的箭头(一条带有一个箭头指向 B 的线)来说明。

编写在这个箭头方向导航的 OCL 约束真的是标准的一部分吗?

我在 OCL 规范中找不到任何相关信息,请参阅 here

UML 中的导航指示不是绝对的,而只是指示您如何轻松导航。

来自 UML 2.5 规范

Navigability means that instances participating in links at runtime (instances of an Association) can be accessed efficiently from instances at the other ends of the Association. The precise mechanism by which such efficient access is achieved is implementation specific. If an end is not navigable, access from the other ends may or may not be possible, and if it is, it might not be efficient.

所以我想 OCL 应该能够以两种方式导航,无论导航能力如何。