1

how can i use a Map in OCL. For example i want to get all bills for user c1 and my Map 'purchases' looks like Map <Date, Bill>.

c1.purchases.Bill? Is this possible?

regards

1thingtodo
  • 95
  • 2
  • 15

1 Answers1

0

The ability to synthesize a map in OCL from a Set(Tuple(K,V)) is something that I and others have been guilty of advocating. A Map(K,V) maintains a single unique V entry per K, whereas a Set(Tuple(K,V)) may have many V's for the same K; not the same at all.

Eclipse OCL therefore has a Map(K,V) as part of its modeled standard library that might eventually make it into the standard.

Regards

Ed Willink

Ed Willink
  • 1,205
  • 7
  • 8