next up previous top
Next: Connector
Up: Composite Implementation
Previous: Bind

Establish

Description

The <establish> statement in UniCon is a form of syntax that, in a single statement, implicitly instantiates a connector and specificies all of the associations of players in an implementation to any of the connector's roles. It is equivalent to using an
<instantiation> statement to instantiate a connector, and then immediatly following it with <connection> statements that specify all of the player/role associations involving the roles in the previously instantiated connector.

The <establish> statement can simplify the task of instantiating a connector and associating players with its roles. In one statement, both tasks are accomplished. Whereas the syntax of the <connection> statement allows the associations between players and roles to appear in any order in a composite implementation, it is often helpful, however, to group together all the <connection> statements for one connector instantiation in one place. The syntax of the <establish> statement requires the designer to perform this grouping.

When grouping player/role associations in this manner, the connector instance name is purely local to the group. The <establish> statement eliminates this name by implicitly instantiating the connector. The connector is not given a name by which it can be referred to. Therefore, the roles of such a connector cannot be referred to outside the scope of the <establish> statement, forcing the designer to specify all player/role associations involving roles in the connector inside the given <establish> statement.

NOTE: The syntax of an <establish> is not symmetrical with respect to components; it cannot be used to instantiate components and associate roles with its players.

The property list of an <establish> statement has identical semantics to the property list of a connector <instantiation>. This means that properties that are legal and illegal in a property list of a connector <instantiation> of a given type are legal and illegal, respectively, in an <establish> of the same type of connector.

Syntax

The following is the syntax for an <establish> statement:

<establish> :== 
  ESTABLISH <identifier> WITH
    <establish_association_list>
    <property_list>
  END <identifier>
<establish_association> :== <identifier>.<identifier> AS <identifier>
The <identifier> following the word ESTABLISH must name a connector definition, not an instantiation. This is because the <establish> statement performs the connector instantiation.

The <establish_association_list> is a whitespace-separated list of <establish_association>s, and the list must contain at least one association. The <establish_association> looks remarkably similar to the association part of a <connection> statement, However, there are differences. Since there is no connector instantiation name, only one identifier is needed to identify the role in the association. Therefore, the dot-separated pair of <identifier>s before the word AS must name a player, and the single <identifier> following the AS must name a role in the connector named by the <identifier> following the word ESTABLISH. There is no pre-defined language limit to the number of <establish_association>s that can be present in the list.

Properties

As mentioned above, the properties that are legal and illegal in a property list of a connector <instantiation> of a given type are legal and illegal, respectively, in an
<establish> of the same type of connector.

Example

The following are two examples of the <establish> statement. The first one shows an <establish> of a ProcedureCall connector with no additional properties. The second one shows an <establish> of an RTScheduler connector with properties. The second example is equivalent to the combined syntax of the Example sections for the
<instantiation> statement and the <connection> statement:

  ESTABLISH C-proc-call WITH
    my_main_program.malloc AS Caller
    libc.malloc AS Definer
  END C-proc-call
The above example assumes that the "libc" component contains a RoutineDef player named "malloc," and that the "my_main_program" component contains a RoutineCall player named "malloc." It also assumes that there exists a UniCon definition for a ProcedureCall connector named "C-proc-call."

  ESTABLISH Real_Time_Scheduler WITH
    RTClient.load AS load
    RTServer.load AS load
    ALGORITHM (rate_monotonic)
    PROCESSOR ("TESTBED.XX.CMU.EDU")
    TRACE (RTClient.load.trigger,
        RTClient.load.segment1,
        RTServer.load.segment,
        RTServer.load.segment2)
  END Real_Time_Scheduler

next up previous top
Next: Connector
Up: Composite Implementation
Previous: Bind

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996