Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Connecting misaligned modules



If the interfaces of two modules are not really compatible, there are still ways to allow to connect them:
  • If the services contain the same datas but don't have the same Service names, you can use a service alias
  • If the services are completely different but share some common informations that you want to use, you can use the Service merger Application to make the connection

Example usage of a Service alias

This example shows a use case for the Service alias.

The misaligned Service names problem

Suppose we have the following architecture:
servicealias1
We have two modules:

The aircraft module which uses the aircraft acPosition:
      <module name="Aircraft" >
         <interfaces>
            <subscribe service="acPosition" />
         </interfaces>
      </module>
We have the following services definition:
      <services>
         <publish name="acPosition">
            <data name="latitude" type="float" />
            <data name="longitude" type="float" />
            <data name="altitude" type="float" />
         </publish>
      </services>
And the SimulationEngine module which computes the aircraft position:
      <module name="SimulationEngine" >
         <interfaces>
            <push service="position" />
         </interfaces>
      </module>
We have the following service definition:
      <services>
         <publish name="position" >
            <data name="latitude" type="float" />
            <data name="longitude" type="float" />
            <data name="altitude" type="float" />
         </publish>
      </services>
We would like to compute the aircraft data by the SimulationEngine module and use them by the aircraft module but is is not possible because they use different names for the Services services even if in fact they use the same datas. One solution is to define the position Service to be an alias for the acPosition Service.

Service alias solution

We define position Service to be an alias for the acPosition Service, with the following architecture:
servicealias2
We will have the following Services configuration:
      <services>
         <publish name="position" >
            <data name="latitude" type="float" />
            <data name="longitude" type="float" />
            <data name="altitude" type="float" />
         </publish>
         <alias name="acPosition" service="position" />
      </services>

Example usage of a Service merger

This example shows a use case for the Service merger built-in application.

The misaligned Services problem

Suppose we have the following architecture:
servicemerger1
We have two modules:

The aircraft module which uses the aircraft attitude and position:
      <module name="Aircraft" >
         <interfaces>
            <subscribe service="attitude" />
            <subscribe service="position" />
         </interfaces>
      </module>
We have the following services definition:
      <services>
         <publish name="attitude" >
            <data name="theta" type="float" />
            <data name="phi" type="float" />
         </publish>
         <publish name="position">
            <data name="latitude" type="float" />
            <data name="longitude" type="float" />
            <data name="altitude" type="float" />
         </publish>
      </services>
And the SimulationEngine module which computes the aircraft characteristics:
      <module name="SimulationEngine" >
         <interfaces>
            <push service="aircraftModel" />
         </interfaces>
      </module>
We have the following service definition:
      <services>
         <publish name="aircraftModel" >
            <data name="theta" type="float" />
            <data name="phi" type="float" />
            <data name="acLatitude" type="float" />
            <data name="acLongitude" type="float" />
            <data name="acAltitude" type="float" />
         </publish>
      </services>
We would like to compute the aircraft data by the SimulationEngine module and use them by the aircraft module but is is not possible because they use different services even if in fact they use the same datas. it is not in this case possible to use a Service alias because just renaming a Service would not work. One solution is to define another module using the Service merger Application.

Service merger solution

We can define a new Service merger Application with the following architecture:
servicemerger2
This module will make the bridge between the aircraftModel Service and the position and attitude Services.
      <mergerConf>
         <outputService name="attitude" >
            <inputService name="aircraftModel" />
            <data name="theta" fromData="theta" fromService="aircraftModel" />
            <data name="phi" fromData="phi" fromService="aircraftModel" />
         </outputService>
         <outputService name="position" >
            <inputService name="aircraftModel" />
            <data name="latitude" fromData="acLatitude" fromService="aircraftModel" />
            <data name="longitude" fromData="acLongitude" fromService="aircraftModel" />
            <data name="altitude" fromData="acAltitude" fromService="aircraftModel" />
         </outputService>
      </mergerConf>

Categories: troubleshooting

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence