Tuple

A Tuple is fancy word for something “taped together from bits and pieces of other stuff”. This is very useful when it comes to build result sets that is not necessary something that exists in your model. Like sums or collecting name and address together even if they are stored in different classes.

Tuples are what an sql server return when you omit the “*” and write explicit stuff in the select part. In fact the columns in the select part is the tuple-definition as far as the sql server is concerned.

OCL operators that create tuples are

Example

IElement elem = ocl.Evaluate(“Class1.allinstances.class2.class3->groupby(x|x.Attribute1)”);

So what do I get back? A Tuple

The tuple consists of a type with a generated name and specific properties. The properties are: Attribute1 and List.

The code below shows how to access the tuple result in code:

This page was edited 97 days ago on 02/10/2024. What links here