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

Example usage of a Service alias



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>

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