Skip to content

Converting a table into a class

Leon Starr edited this page Sep 5, 2021 · 1 revision

You cannot convert a table directly into a class since there are usually referential attributes involved and it would be quite easy to violate referential integrity by populating a table with invalid references.

But you can convert a table into a set of instance references and then assign those to an instance set variable like so:

tlow #= Aircraft(Altitude < floor)
tids #= tlow.(Tail number)
low flying aircraft::Aircraft ..= tids

We need to specify a table whose header is a superset of at least one of the target class’s identifiers. In this case it just means that the table tids must have Tail number in its header.

Note that we need the :: type definition symbol to ensure that the instance set variable is defined on the correct class.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally