# Binding Editor

The binding editor provides a tabular visualization of all bindings (playedBy, callout, callin) of a given team class. After selecting a team class the binding editor can be invoked using Open Binding Editor from the context menu.

## Visualization

The top half of the binding editor consists of three columns: role, binding kind, base. All elements nested in a team or role class can be collapsed/expanded as in other structural views.

## Editing

Bindings can be edited at three levels: types, methods, parameters. Especially, when creating the "Connector" in the Connector Pattern, the binding editor may be all you need, i.e., the full connector definition can be generated using the binding editor with no need to edit source code in the Java editor.

### Adding playedBy bindings

When clicking Add Type Binding you are presented with a twofold type selection dialog.

On the left hand side select one of the role types inherited from the super team, on the right hand side select the base class you wish to bind to the role using `playedBy`. When clicking OK this information will be used for creating a new role class overriding the selected role from the super team and bound to the selected base class.

### Adding method bindings

Method bindings are created in the lower half of the binding editor.

For creating a callout binding between an existing role method and a base method simply select both methods from the respective lists of Role Methods / Base Methods, also select -> between both lists and click Apply.
If the selected role method is not abstract, select => for an overriding callout. For creating a callout binding without an existing role method select 'New Method() from the left list.

For creating a callin binding simply select both methods from the respective lists of Role Methods / Base Methods, also select one of the callin kinds <- before, <- replace, or <- after between both lists and then click Apply.

### Adding parameter mappings

For creating a parameter mapping first select the method binding, then switch to the tab Parameter Mapping Configuration.

Depending on the binding direction enter details in the fields showing either <- or -> between them. On the target side (where the arrow is pointing to) select one of the declared parameters, on the other side enter a Java expression that can be resolved in the given scope. Don't forget to create each individual parameter mapping using Apply.

When closing the binding editor using OK all pending changes will be generated into the appropriate source file.