Running Object Teams programs

Technically running an Object Teams program involves a special runtime enviroment (the OTRE - Object Teams Runtime Environment) which provides fundamental classes and performs load-time weaving for connecting aspects with their bases. All this is hidden as to make running Object Teams programs as easy as running Java programs.

Running your program is possible in two ways:

The former derives most of the launch parameters from your ObjectTeams/Java project and your workbench preferences. Simply select your class containing the main method in the package explorer, open the context menu and choose Run (or Debug) > Object Teams Application.

For the other method, you must define a new launch configuration. There you can also specify execution arguments for your program.

  1. Select Run > Run... (or Run > Debug...) from the workbench Run menu or from the pop-up menu in the package explorer or by choosing Run... from the drop-down menu on the Run button in the workbench toolbar to open the list of launch configurations. Launch configurations for Object Teams programs are shown by the label Object Teams Application.
  2. Create a new launch configuration by pushing the New button after selecting Object Teams Application.
  3. Enter a name for your launch configuration.
  4. Specify additional settings/informations like program arguments as desired.
  5. Click Apply when you are done. Then click Run if you want to run your program or Close if you only want to close the dialog without executing your program.

Launch configuration dialog

Specific Parameters

The following options are offered:

Team activation:

I you wish to compose your program from a base application and a number of aspects, you may use a launch configuration to select which aspects should be included. Use the tab Team Activation to select existing teams and put them into the desired order.

The effect is that each team in the list will be instantiated and activated before the main method of the program executes. This can actually be observed if Stop in main is checked for debugging: the program will actually stop before entering main, the next step will perform all pending team instantiations/activations and only then the program starts (You might want to use the team monitor to observe team instantiation/activation).

Since a team can intercept method calls in a base application simply adding a team to an existing application can indeed produce different behavior.