Table - modelint/shlaer-mellor-metamodel GitHub Wiki

A Table is simply a header consisting of a set of, possibly zero, Table Attribute, Scalar pairs.

So you can think of a Table as an empty table definition, much like a Class. Unlike a Class, a Table is meant to hold intermediate computational results that do not persist outside the scope of an Activity.

In fact, it is a Table Flow (a populated table) that is scoped entirely within an Activity. A Table definition, however, may be associated with a parameter definition, a method output and in any place a Type can be applied. So while a Table Flow exists in a single Activity, a Table definition (type) may be used in the context of multiple Activities.

Note about Table naming

Unlike Scalars and Classes, Tables are tricky to name. Scalar types are named when they are defined in some external typing systems and then we just map those names into the metamodel as a Type Name. Class names are defined in the class model.

But when and where do we name a Table? Sometimes we do it when we assing a labeled Table Flow. Here's an example:

lower level floor heights #= Floor( Height < middle height ).Height

But we aren't really naming the Table with the name on the left of the assignment. We are simply attaching a Label to the Table Flow.

And if we perform a computation, we end up with unlabeled Table Flows such as these on the right hand side of the statement below:

destination heights #= ((requested stops.(Floor, Shaft) + requested floors) ## Floor[Name >> Floor]).(Floor, Height)

To tell one Table apart from the other we can concatenate the header into one long string. This involves combining all of the Table Attribute names and Scalar types.

So the table in our first statement could be named:

Height_Distance

Following this pattern, the names of the two in the second statement example would be:

Floor_Level Name_Shaft_Shaft ID and Floor_Level Name_Height_Distance

There are only two since the two Table Flows in the union (+) operation must be of the same type and hence each share the same table header. The operand to the right of the join (##) operation does have a distinct Table type.