Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何在 OCL 中使用地图。例如,我想获取用户 c1 的所有账单,而我的地图“购买”看起来像 Map <Date, Bill>。
Map <Date, Bill>
c1.purchases.Bill?这可能吗?
问候
在 OCL 中从 Set(Tuple(K,V)) 合成地图的能力是我和其他人一直在提倡的。Map(K,V) 为每个 K 维护一个唯一的 V 条目,而 Set(Tuple(K,V)) 可能有许多 V 对应相同的 K;完全不一样。
因此,Eclipse OCL 将 Map(K,V) 作为其建模标准库的一部分,最终可能将其纳入标准。
埃德·威林克