PLUG : Presentation Layer Universal Generator

36
PLUG PLUG Presentation Layer Universal Generator Presentation Layer Universal Generator P&D/SSD/TCE/TFP/AST P&D/SSD/TCE/TFP/AST A joint company of Thomson-CSF Airsys and Siemens

Transcript of PLUG : Presentation Layer Universal Generator

Page 1: PLUG : Presentation Layer Universal Generator

PLUG PLUG Presentation Layer Universal GeneratorPresentation Layer Universal Generator

P&D/SSD/TCE/TFP/ASTP&D/SSD/TCE/TFP/AST

A joint company of Thomson-CSF Airsys and Siemens

Page 2: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20042

OVERVIEW

� Object Oriented Design to automatic code generation� Compiler & Parser� PLUG (Presentation Layer Universal Generator) through

applications :� Coder generation : Object Message Passing� Stub generation : PATIO API

� Future

* PATIO : Platform for ATM Tools Integration to Pre-operation

Page 3: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20043

PLUG : Presentation Layer Universal Generator

� OSI layer 6 & 7 services� Manages heterogeneous programming

languages and hardwares� Provides Plug & Play (flexibility)

=> Automatic code generation

=> Object Oriented Design

Application

Presentation

Session

ASN.1*

7

6

5

ASE* ASE ASE ASE

Page 4: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20044

Object analogy

Implementation Interface

A driver doesn't care of engine's internal working.He only knows the interface

Page 5: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20045

Specification Language

Network

Node A Node B

IRS (IDL)Struct message1

Item1 : short;Item2 : long;Item3 : char;Item4 : Boolean;Item4 : Struct data

Item1 : :char;Item2 : long;Item3 : char;Item4 : BooleanItem4 : char;

end struct data;end struct message1

Communication Language

ProgrammingLanguage (C++)

ProgrammingLanguage (Ada)

Communication Object Design

Page 6: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20046

Syntax and Language

� Abstract Syntax : specification language : � ASN.1, IDL, (ADA)

� Working Syntax : programming language : � ADA, C, C++

� Transfert (concrete) Syntax : communication language : � BER/PER, XDR, CDR, � ASTERIX, ADEXP, ICAO

Page 7: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20047

Compiler VS Parser

� Abstract Syntax is independent of Transfertsyntax :� Automatic code generation : Compilers

� If no Abstract Syntax (AS = TS) :� Manual code generation : Parsers

Page 8: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20048

PLUG Compilers

� ABSTRACT SYNTAX� PLUG Ada RPC : API� PLUG ASN.1 : ATN� PLUG IDL : CORBA

Front End (FE)

� TRANSFERT SYNTAX� PLUG XDR : API� PLUG BER/PER : ATN� PLUG CDR : CORBA, ESIOP

Back End (BE)

Page 9: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/20049

PLUG Parsers

� PLUG ASTERIX : � Radar, Meteo, Categorie XX

� PLUG ADEXP : � Flight Plan, ATS, AIS, CFMU, IFPS,

OLDI

� PLUG ICAO : � Flight Plan, Meteo, Notam, ATS, OLDI

Tracks

Primaryand secondary RADAR

Page 10: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200410

XDR

Stub Generator Coder Generator

C Ada

Ada API

C Ada

PLUG : Presentation Layer Universal Generator

(IDL)

(CDR)(IDL,C++)

Page 11: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200411

PLUG Coder generator

IFF

XDR/C generatedencoding source files

Front End(lex/yacc)

Back End

XDR/ADA generatedencoding source files

AdaGrammar(BNF)

grammar analyzegrammar analyze

XDR Templatesexpansion

XDR Templatesexpansion

XDRTemplates

(TDL)

AdaAPI

Independant Format File

Independant Format File

Abstract Syntax Tree

Page 12: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200412

PLUG Compilers through applications

� Message passing object design� XDR� Coder generator

� Distributed Object Design : API (IDL) PATIO� UBSS based Ada RPC � Stub generator

� Miscellanous� Symbolic trace and debug functions� Programming Language translator

Page 13: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200413

Object message passing with PLUG

� UBSS manages pipes not the semantic of transported messages

� PLUG Coder are used to manage FIFO and CDC messages.

� Ada type specification is used as Specification input file (AS)

� IRS documents are replaced by Ada specification

Page 14: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200414

Plug coder use : FIFO encode/decode

FIFOEnqueue Dequeue

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type Ada Type C

Ada

XDR

XDR

C

Call Back encoding routing

XDR buffer

ToolsUser Tools User

Page 15: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200415

Plug coder use : CDC encode/decode

Ada

XDR

XDR

C

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type Ada Type CCall Back encoding routing

CDCCDC_write() CDC_read()

Page 16: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200416

AdaCSCI

CCSCI

XDR

Ada Compiler C Compiler

XDR : How it works.

Page 17: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200417

C/XDRCoder

(C)

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDRCoder(Ada)

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

InterfaceSpecification

Abstract Syntax

Transfert Syntax

Programming SyntaxProgramming Syntax

Object Message Passing Syntax

Page 18: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200418

Coder : Structure Serialization

Struct Message Type 1 Field AField B

Field CField D

Field EField FField G

End struct Message type1

Ada or C structure

XDR Stream

XDR Convertor

Elementary types are : Int, Char, float, Boolean Field 1Field 2Field 3Field 4Field 5 Header

Type 1

A B

C D

E

F G

Page 19: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200419

C/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

InterfaceSpecification

C/XDRCoder

Generator

Ada to CTranslator

Ada/XDRCoder

Generator

Ada PackageSpecification

(With)

Code generation output

Page 20: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200420

PLUG Generated Files

� PLUG/XDR generates 5 Files :� ADA :

� 1. Coder specification (.ads)� 2. Coder body (.adb)

� C :� 3. API header file (.h)� 4. Coder specification (.h)� 5. Coder body (.c)

� The Ada API header file (specification) is the API specification itself.

Page 21: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200421

PLUG Generated Files

AdaAPI

.h.h

.c.c

.ads.ads .h.h .ads.ads

.adb.adb

1 2 4

53Ada and C structure

Ada and C XDR Coder

=

Page 22: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200422

Ada Program C ProgramXDR format disk file

PUT (Ada Type)

GET ( Ada Type)

read (C Type)

write (C Type)

Plug coder use : Off line file universal format

Page 23: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200423

C/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamC/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

C/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

Ada/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

Coder context

Page 24: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200424

PATIO API paradigm� Software components Plug & Play

� Vertical services, Frame work, Design Patterns

� Business Middleware = OSI layers 7,5,6 = ORB Core services

� Business APIs = OSI layer 7 ASEs = CORBA objects

� Business Middleware is also called API layer because it exhibitsonly application APIs.

� An API (as an ASE) is :� A protocol and � A logical interface (API = abstract syntax) : IRS

* IRS : Interface Requirements Specification.

Page 25: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200425

API protocol

UBSS

API(SKELETON)

APPLI

UBSS

API(STUBS)

APPLI

ServerClient

API PROTOCOL

UNIX

LAN

UNIX

API

Page 26: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200426

API : How it works

� API protocol is equivalent to Sun RPC (Remote Procedure Call) with asynchronous events

� Servers Publish service interface and clients subscribe to services

� Client invokes remote procedures executed by the server or receives asynchronous event

� Each server exports interfaces.� RPC encapsulates network access :

� Send/Receive are hidden by Application functions call� RPC protocol manages parameters passing between client to

server.� XDR (External Data Representation) manages heterogeneous

programming language and hardware : Ada, C, C++.

Page 27: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200427

RPC principle

Library

Main

Push

Pop

Unix process

Library

Main

Send

Receive

Unix process

Client Server

Marshalling

Unmarshalling

=>XDR

XDR

Unix process

S = A+ B

A, B, +

S

Page 28: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200428

API : Ada distributed Package

Ada Packagespecificationc

Ada PackageImplementation

OperationsOperations

DATAand

Operations Implementation

DATAand

Operations Implementation

OperationsOperations

EmptyImplementation

Comms

EmptyImplementation

Comms

OperationsOperations

DATAand

Operations Implementation

DATAand

Operations Implementation

Client side Server side

=>

Page 29: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200429

Heterogeneous Distributed System : Language or Hardware

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Main API interface Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Ada ServerUnix Process

C ServerUnix Process

C++ ServerUnix Process

Ada or C or C++Client

Unix Process

Page 30: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200430

API Programming model : Client Register; Start Supervision APIRegister with supervisor; Subscribe to supervision eventsProgram Main Loop

Wait next event Case API

Supervision :peek event from supervision :

process supervision events : Initialise, start, stop, killAPI1 :

peek event from API 1 :process AP1 events : ............

API2 :peek event from API 2 :

process AP2 events : ............End loopStop event processingStop API1, API2Stop supervision APIUnregister

Underlying code is the stubautomatically generatedby PLUG.

Itallic code is written by applicationprogrammer.

Page 31: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200431

S u p e r v i s e d

I n i t i a l i s e d

R u n n in g

I n i t i a l i s e / S t a r t S e r v i c e s & S u b s c r i b e

S t a r t / P r o c e s s E v e n t s

K i l l / U n r e g i s t e r

U n s u p e r v i s e d

/ S t a r t s u p e r v i s i o n , R e g i s t e r & S u b s c r i b e

U n r e g i s t e r e d

/ R e g i s t e rE v e n t / A c t i o n

F r o z e n

U n f r e e z e / P r o c e s s E v e n t s

S t o p / S t o p s e r v i c e s

K i l l / S t o p S e r v i c e s & U n r e g i s t e r

F r e e z e / D o n ' t p r o c e s s E v e n t s

Client state diagram

Page 32: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200432

PLUGStub Generator

Register; Start Supervion APIRegister with supervisor; Subscribe to supervision eventsProgram Main Loop

Wait next event Case API

Supervision :peek event from supervision :

process supervision events : Initialise, start, stop, killAPI1 :

peek event from API 1 :

process AP1 events : .

API2 :peek event from API 2 :

process AP2 events : ............

API3 :peek event from API 2 :

process AP2 events : ............End loopStop event processingStop API1, API2Stop supervision APIUnregister

• Program skeltons are automatically generated by PLUG.• Stub generation is template driven.• Templates are written with PLUG Template Description Language (TDL).

Template

All Technical Middelware details are hidden to the programmer : Registry, Supervision, Subscription.

Page 33: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200433

Plug other possible applications

� Symbolic trace and debug functions� Complex structure symbolic dump

� Programming Language Translator� Ada to C, Ada to C++

� Off line and recording files management� XDR standard file format

Page 34: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200434

Sum Up

� Object Oriented Design is mandatory to manage heterogeneous programming language and hardware to provide P&P.

� Three kinds of services� Ada abstract syntax for Object Message Passing� UBSS based Object Middleware : API� Handcrafted Parser for ATC specific Transfer

Syntax

Page 35: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200435

IFF

IDL Front End

CORBAIDL

PLUG modularity

ADa Front End

AdaAPI

ASN.1 Front End

ASN.1

CDR Back End

CDR generated encoding source files

XDR Back End

XDR generated encoding source files

BER/PER BE

BER/PER generated encoding source files

Page 36: PLUG : Presentation Layer Universal Generator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 3/28/200436

Future

� IDL based ASTERIX compiler� States chart based code generation for Object

dymanic� ASE Skelton automatic generation� Business Object Skelton automatic generation� Ada/C++ translator