linkage

linkage is one or many optional nested definitions within UDTs defining relationships to other types.

Linkage is used to express named, loosely-coupled relationships between types.

  • entity, key, record and trait support nested linkage definitions.

  • A linkage has an associated name. Multiple uniquely named linkages can be associated with a user-defined type. Linkages defined in traits become part of UDTs that includes the trait.

  • A linkage can be denoted as 1-to-1:

    // Outer type definition
    ...
       linkage <Unique linkage identifier 1>
                ( < list of columns from current type > )
              < linked type name >
                ( < list of columns from linked type > )
    
  • As optionally 1-to-1:

    // Outer type definition
    ...
       linkage <Unique linkage identifier 1>
                ( < list of columns from current type > )
              < linked type name > ?
                ( < list of columns from linked type > )
    
  • Or as 1-to-many using a list of targets:

       linkage <Unique linkage identifier 2>
                ( < list of columns from current type > )
               list< < linked type name > >
                ( < list of columns from linked type > )
    ...
    

Visualising Linkages

Linkages are displayed alongside the model documentation, as shown in the example below.

ALFA Linkage Example