Next: , Up: How to use ‘external'?   [Contents]


4.2.1 Responsibilities and using ‘external’ components

To make it easier to accommodate for concurrent behaviours found in ‘external’ ports, it is recommended to define another component that provides the ITimer interface and requires an external ITimer interface. Then, in the System component, bind the provided ITimer port of the new component to the required ITimer port of the Controller. From the Controller point of view, the ITimer port is no longer ‘external’. Instead, the new component (let’s call it RobustTimer) becomes responsible for translating the ‘external’ ITimer port to a regular ITimer port.

If you’ve performed the steps above, the situation should now look like this:

component RobustTimer {
  provides ITimer iTimer;
  requires external ITimer ext_iTimer;

  behaviour {

  }
}
images/system_7 images/system_8

Note that the required ‘external’ ITimer port on RobustTimer is coloured yellow; this is the case for all ports that are marked ‘external’. It is an easy way to identify these ports when looking at the System view. Note that the required ITimer port in Controller is no longer marked ‘external’.