Stephan Herrmann | 746330b | 2011-06-03 16:17:37 +0000 | [diff] [blame^] | 1 | <html> |
| 2 | <head> |
| 3 | <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2011. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" /> |
| 4 | <link rel=stylesheet type="text/css" href="../css/book.css"> |
| 5 | <link rel=stylesheet type="text/css" href="otjld/css/ot.css"> |
| 6 | <link rel=stylesheet type="text/css" href="otguide.css"> |
| 7 | <style type="text/css"> |
| 8 | body { margin:10px; } |
| 9 | .high { background-color:#a5b7bd;color:white; } |
| 10 | .low { background-color:#fff0c8; padding:2px; } |
| 11 | .caption { text-decoration:underline; vertical-align:top;position:relative;top:20px; margin-top:10px;} |
| 12 | </style> |
| 13 | <title>Binding Editor</title> |
| 14 | <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| 15 | </head> |
| 16 | <body> |
| 17 | <h1 align="center">Binding Editor</a></h1> |
| 18 | The binding editor provides a tabular visualization of all bindings (playedBy, callout, callin) of a given team class. |
| 19 | After selecting a team class the binding editor can be invoked using <span class="ui"><img src="../images/calloutbinding_obj.gif">Open Binding Editor</span> from the context menu. |
| 20 | <h2>Visualization</h2> |
| 21 | The top half of the binding editor consists of three columns: <b>role</b>, <b>binding kind</b>, <b>base</b>. |
| 22 | All elements nested in a team or role class can be collapsed/expanded as in other structural views. |
| 23 | <img alt="Binding Editor" src="images/screenshots/BindingEditor_FlightBonus.png"> |
| 24 | <h2>Editing</h2> |
| 25 | Bindings can be edited at three levels: <b>types</b>, <b>methods</b>, <b>parameters</b>. |
| 26 | Especially, when creating the "Connector" in the <a href="http://wiki.eclipse.org/OTPattern/Connector">Connector Pattern</a>, |
| 27 | the binding editor may be all you need, i.e., the full connector definition can be generated using the binding editor |
| 28 | with no need to edit source code in the Java editor. |
| 29 | <h3>Adding playedBy bindings</h3> |
| 30 | When clicking <span class="ui">Add Type Binding</span> you are presented with a twofold type selection dialog. |
| 31 | <p> |
| 32 | <img alt="Add Type Binding" src="images/screenshots/BindingEditor_AddTypeBinding.png"/> |
| 33 | </p> |
| 34 | On the left hand side select one of the role types inherited from the super team, |
| 35 | on the right hand side select the base class you wish to bind to the role using <code class="keyword">playedBy</code>. |
| 36 | When clicking <span class="ui">OK</span> this information will be used for creating a new role class |
| 37 | overriding the selected role from the super team and bound to the selected base class. |
| 38 | <h3>Adding method bindings</h3> |
| 39 | Method bindings are created in the lower half of the binding editor. |
| 40 | <p> |
| 41 | For creating a <b>callout</b> binding between an existing role method and a base method |
| 42 | simply select both methods from the respective lists of Role Methods / Base Methods, |
| 43 | also select <span class="ui">-></span> between both lists and click <span class="ui">Apply</span>.<br/> |
| 44 | If the selected role method is not abstract, select <span class="ui">=></span> for an overriding callout.</br> |
| 45 | For creating a callout binding without an existing role method select <span class="ui"><img src="images/add_correction.gif"> 'New Method()</span> |
| 46 | from the left list. |
| 47 | </p> |
| 48 | <p> |
| 49 | For creating a <b>callin</b> binding simply select both methods from the respective lists of Role Methods / Base Methods, |
| 50 | also select one of the callin kinds <span class="ui"><- before</span>, <span class="ui"><- replace</span>, or <span class="ui"><- after</span> |
| 51 | between both lists and then click <span class="ui">Apply</span>.<br/> |
| 52 | </p> |
| 53 | <h3>Adding parameter mappings</h3> |
| 54 | For creating a parameter mapping first select the method binding, then switch to the tab <span class="ui">Parameter Mapping Configuration</span>. |
| 55 | <p> |
| 56 | <img alt="Create Parameter Mapping" src="images/screenshots/BindingEditor_ParameterMappings.png"/> |
| 57 | </p> |
| 58 | Depending on the binding direction enter details in the fields showing either <span class="ui"><-</span> or <span class="ui">-></span> |
| 59 | between them. |
| 60 | On the target side (where the arrow is pointing to) select one of the declared parameters, on the other side enter a |
| 61 | Java expression that can be resolved in the given scope. Don't forget to create each individual parameter mapping using <span class="ui">Apply</span>. |
| 62 | <hr/> |
| 63 | <p> |
| 64 | When closing the binding editor using <span class="ui">OK</span> all pending changes will be generated into the appropriate source file. |
| 65 | </p> |
| 66 | </body> |
| 67 | </html> |