[furcas-discussion] Constraints regarding ForEachContext.contextElement

Uhl, Axel axel.uhl at sap.com
Thu Feb 17 17:49:18 CET 2011


Hi,

looking even closer at the foreach-related code there unfortunately are more issues. The specification allows for foreach expressions to have a non-EObject result type, such as String or Boolean. I'm pretty sure this won't work, and we don't have test cases asserting this functionality which is bad. The contextElement reference in ForEachContext is typed as EObject. Therefore it's unable to hold String or Boolean values.

Another thing to keep in mind is that generally it is possible that a foreach expression results in a Bag containing several occurrences of equal elements for each of which an element has been produced. This in particular means that the corresponding ForEachContext elements have equal contextElement contents. What should our constraints be w.r.t. ordered features?

Imagine the following situation: a foreach expression may produce [e1, e2, e1] for which elements [f1, f2, f3] are produced. When something changes such that the foreach expression only produces [e1, e2] then intuitively speaking we may expect the feature to be updated to [f1, f2] and not [f2, f3}. See what I mean?

I think we should approach a more formal specification of features such as "foreach" because otherwise we'll end up in a big mess.

Opinions on how such a specification for the foreach-feature should look like?

Best,
-- Axel


More information about the Furcas-discussion mailing list