136
CORBA for transportation control and command systems tutorial

CORBA tutorial Boston2003

Embed Size (px)

DESCRIPTION

CORBA tutorial

Citation preview

Page 1: CORBA tutorial Boston2003

CORBA for transportation control and command systems tutorial

������������ ���������������������������

Page 2: CORBA tutorial Boston2003

2

31/0

3/0 3

Thales Air Traffic Management

CORBA ATC use case, Note to offline reader.

� �������������������������������� ���������������������������� ������������������������������������������������ ������ ��! ����������������������"��������#�����������! ������������������������! ���������� ��������#��������������"�������#��������

$�%����#��������"����������"��! ��! ���������&�������� �'�������� (���������������� ��������)�"�������������"�����#���������#��������������"���������������

� ���%�������"���������&������! �����������������������(��������#��� ����������������#�! �����&����! �������*��)�"����"�����#����

���"��������������! ������"�����������#���������������������! ����! ��%��! �! ����! ����������! ���"�����#��� ���! ����(�����%��! ����������������������#�������������

� ���������������������"����"���'��������#������"��������������������(����(������������"���'�������������"�������������������������"�����#�������������������������#������������������"������������������"�������%��! ���#��

Page 3: CORBA tutorial Boston2003

3

31/0

3/0 3

Thales Air Traffic Management

The open issue :

����� �������������$��#���������������������+ ��������"���������� �����"��������+ ������,�

,

Page 4: CORBA tutorial Boston2003

4

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 5: CORBA tutorial Boston2003

5

31/0

3/0 3

Thales Air Traffic Management

Why CORBA ?

� ��)�"����"�����#���(��"���������"������������! ������(�����������������(�����#����-������������"����������������

. ���������������������/

� 0 ��! �������������)�"��������������� �"�����#��� ���(��"���������"�����������#������������������! ������(�����������������(�����#����-������������"���������������

� �� �����(�������������������)�"��������������

Page 6: CORBA tutorial Boston2003

6

31/0

3/0 3

Thales Air Traffic Management

Practical Use Case

� 0 ������#���#����������! ��� ��������

� + ������+ �������� ���#������

� 1 ��"�����+ ���������������"������2(�������

���������! ��%�,

� 3 �! ������������! ��%�,

� 0 ���� ������������(���� ,

� 2&�������

Page 7: CORBA tutorial Boston2003

7

31/0

3/0 3

Thales Air Traffic Management

Complex system : ATC center

Flight PlanProcessingFlight Plan

Processing

SupervisoryControlSupervisory

Control

SimulatorSimulator

RecordingReplayRecording

Replay

controllerWorkingPosition

controllerWorkingPosition

Radar Data ProcessingRadar Data

Processing

Radar FrontProcessingRadar Front

Processing

LAN

AFTN/CIDINATFM

ADJACENTFIR'S/TWR'S

MET Centres

Voice control and

communicationsVoice control

and communications

• Intercom• Priority• Public• RADIO A/G

controllerWorkingPosition

controllerWorkingPosition

4�56

�����

Page 8: CORBA tutorial Boston2003

8

31/0

3/0 3

Thales Air Traffic Management

Object At system level ?

� � ���-������������"���! ����������)�"����"�����#������������������(���,

� ���! �������� ��(��"������"���������! �����������! ������������)�"��,

� � ������! ������

7 ��� ���������(����������������! ����������������#�������'�! ��������������)�"���������������#��(�����������

�� �������! �������(������������������

Page 9: CORBA tutorial Boston2003

9

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 10: CORBA tutorial Boston2003

10

31/0

3/0 3

Thales Air Traffic Management

What Do We Want

� �����&�+ �������+ �������� ���#��������������������"�

� ����#������"���#��

Page 11: CORBA tutorial Boston2003

11

31/0

3/0 3

Thales Air Traffic Management

�����

��++ ��

��"�����#

What Do We Want !

Supervision

OperatorDisplaySystem

Page 12: CORBA tutorial Boston2003

12

31/0

3/0 3

Thales Air Traffic Management

���#������#�����

�����

��++ ��

��"�����#

��"�����# �����

��++ ��

What DO We Want !

Supervision

OperatorDisplaySystem

Page 13: CORBA tutorial Boston2003

13

31/0

3/0 3

Thales Air Traffic Management

���#������#�����

��"�����# �����

��++ ��

What DO We Want !

Supervision

OperatorDisplaySystem

Page 14: CORBA tutorial Boston2003

14

31/0

3/0 3

Thales Air Traffic Management

We want to Increase Integrated software quality

��������������� ��� ���� ��������� ������ ��

������� ������ ��� ���������� ������� ���������

��� � ��

Page 15: CORBA tutorial Boston2003

15

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 16: CORBA tutorial Boston2003

16

31/0

3/0 3

Thales Air Traffic Management

What We expect ?

0 ��! ���������

���#������#�����

��"�����# �����

��++ ��

Supervision

OperatorDisplaySystem

Page 17: CORBA tutorial Boston2003

17

31/0

3/0 3

Thales Air Traffic Management

What We expect ?

8 ���� ����

+ ��#�����������

Page 18: CORBA tutorial Boston2003

18

31/0

3/0 3

Thales Air Traffic Management

What We May Have :

+ ��(�"���+ ��(�"��

+ ��(�"���

+ ��(�"�� �

+ ��(�"��2

Page 19: CORBA tutorial Boston2003

19

31/0

3/0 3

Thales Air Traffic Management

Spaghetti Plate Syndrome

8 ����������������

�����"���

Page 20: CORBA tutorial Boston2003

20

31/0

3/0 3

Thales Air Traffic Management

Spaghetti Plate Syndrome

+ ��#�����������

+ ��������"����"�

Page 21: CORBA tutorial Boston2003

21

31/0

3/0 3

Thales Air Traffic Management

Spaghetti Plate Syndrome

+ ��#�����������

+ ������ ���#�����

Page 22: CORBA tutorial Boston2003

22

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 23: CORBA tutorial Boston2003

23

31/0

3/0 3

Thales Air Traffic Management

Why CORBA

� 0 �������������������������! ��������

� ��������(����(�������������! ����"�������������#�����������! ������

� ��)�"� + ���! ���� ���

� ��)�"����������������������"����������������������#�������

� 0 ���������)�"�'�"�������������#������������������(���(��������"�������������������������"���������

Page 24: CORBA tutorial Boston2003

24

31/0

3/0 3

Thales Air Traffic Management

Software Component Integration Bus

Software BUS

Page 25: CORBA tutorial Boston2003

25

31/0

3/0 3

Thales Air Traffic Management

Object Software Component Integration Bus

���"������

��)�"�

������#�

��

�� �99:; �(�

������! ���$��#��#�

DistributedPolymorphism

Software Components Evolution

And Replacement

Page 26: CORBA tutorial Boston2003

26

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 27: CORBA tutorial Boston2003

27

31/0

3/0 3

Thales Air Traffic Management

Polymorphism

� ������������

� 1 ��<�����������'��������������� ���������������������������)�"���������"���#��������"������������������������*������

� �����������������������(��������������������! ����"���������

� 0 ��! ��������������������! ����"���������

� �� ��=�������������������������

*GoF stand for Gang of Four. It refers to the pattern seminal book of John Vlissides, Erich Gamma, Richard Helm, Ralph Johnson:

Design Patterns: Elements of Reusable Object-Oriented Software.

Page 28: CORBA tutorial Boston2003

28

31/0

3/0 3

Thales Air Traffic Management

Object Software Component Integration Bus

Object Software BUS

Page 29: CORBA tutorial Boston2003

29

31/0

3/0 3

Thales Air Traffic Management

Object Software Component Integration Bus

Object Software BUS

8 �! ���������

Page 30: CORBA tutorial Boston2003

30

31/0

3/0 3

Thales Air Traffic Management

Procedural versus Object

Procedural Design Object Design

Before Object After Object

Page 31: CORBA tutorial Boston2003

31

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 32: CORBA tutorial Boston2003

32

31/0

3/0 3

Thales Air Traffic Management

Design for changes

� 0 ��"��>���(����?"���#��@

� 0 ����(������������������"���#�������������#�

� �����������������������A���(�������#�������������(��������

� 0 ������������(����������������"�����"���#�

� 0 ��"��>������A������������-�����������������(������#�����#

� ���&���������#���������"���#��

� ���#�������(�������

� � ���������������������������"���#�

Page 33: CORBA tutorial Boston2003

33

31/0

3/0 3

Thales Air Traffic Management

� ��-����������

� ������������"�(���0 ����������������0 ���������#�����������2���������(���������

� � �"�����#�

� ���������"������� �"������#�0 ����� ���

� + %���

� 0 ��$���������B ��������������������������0 �����"�(���������#���+ ���������������; ��

� + ������ ����������"

� 8 ���������

<.�����������������������! ���/

Changes Sources* During Development

Page 34: CORBA tutorial Boston2003

34

31/0

3/0 3

Thales Air Traffic Management

Object Oriented Design

� ���#�������������#���! �"������������"��#��&�����#�"����! ������! �"����

� ��)�"���������������#� .���/����"���-����.������������/�������������"��#�"�������������#�"����! �������"���#��#������&�����#�"����

� 0 �������

� ����"����"���"������! �"����! �������"���#�

� 0 ����������

� ����"����"�������"������! �"���

Page 35: CORBA tutorial Boston2003

35

31/0

3/0 3

Thales Air Traffic Management

Without OOD

Without OOD

Design for no Changes

Stationary System

Page 36: CORBA tutorial Boston2003

36

31/0

3/0 3

Thales Air Traffic Management

Change management before OOD

� �����#�(�������������������"����������������������(��������

� � ���������������������"�����#�����������"�����������

����������� �����������

Caller called

Page 37: CORBA tutorial Boston2003

37

31/0

3/0 3

Thales Air Traffic Management

Change management before OOD

� 0 �����������! ��������"������"������������"����������������������(����"���#����������"������"��������������#������������! �"������������"��������������������

������ � ����

Caller called

No changes

Page 38: CORBA tutorial Boston2003

38

31/0

3/0 3

Thales Air Traffic Management

Change management before OOD

� ������������������! ����������'�! ��������"������"�������"���#�������"������"��������������"���#�������������������������! �"����

������ � ����

� ���� ������

Caller called

Changes

Page 39: CORBA tutorial Boston2003

39

31/0

3/0 3

Thales Air Traffic Management

Change management and code reuse before OO

� ������������������! ����������'�! ��������"������"�������"���#�������"������"��������������"���#�������������������������! �"����

������ � ����

� ���� ������

������� ����

Caller called

Page 40: CORBA tutorial Boston2003

40

31/0

3/0 3

Thales Air Traffic Management

System Integration is a specific change case

� + ����������#��������������������"�����"���#��"������������"��#�����"���������! �"�����

� 0 ��������! �"����������������#���������������������������������������-��(�����

� � ����! �"��������"�����#��������"��

� � ������"������������"�������������"��

���������������

�����������

���������������

Caller Called Caller Called

Page 41: CORBA tutorial Boston2003

41

31/0

3/0 3

Thales Air Traffic Management

Integration case

� + ����������#��������������������"�����"���#��"������������"��#�����"���������! �"�����

� 0 ��������! �"����������������#���������������������������������������-��(�����

� � ����! �"��������"�����#��������"��

� � ������"������������"�������������"��

���������������

�����������

���������������

Caller Called Caller Called

New Code

Old Code

Old Code

New Code

Page 42: CORBA tutorial Boston2003

42

31/0

3/0 3

Thales Air Traffic Management

Pervasive Change

Replaced Module (Changed)

Page 43: CORBA tutorial Boston2003

43

31/0

3/0 3

Thales Air Traffic Management

Pervasive Change

Page 44: CORBA tutorial Boston2003

44

31/0

3/0 3

Thales Air Traffic Management

Pervasive Change

Page 45: CORBA tutorial Boston2003

45

31/0

3/0 3

Thales Air Traffic Management

Pervasive Change

Several Changes Replace and Reused

Page 46: CORBA tutorial Boston2003

46

31/0

3/0 3

Thales Air Traffic Management

Pervasive Change = Spaghetti Plate

+ ��#�����������

After Several Changes Replace and Reused

Page 47: CORBA tutorial Boston2003

47

31/0

3/0 3

Thales Air Traffic Management

Procedural versus Object

Without OOD With OOD

Design For Changes

Evolutionary System

Design for no Changes

Stationary System

Page 48: CORBA tutorial Boston2003

48

31/0

3/0 3

Thales Air Traffic Management

Change management with OO reuse

� 0 ������� ����%����������������� ! ��������"������"������������"��������! �"������������������������������"������

����������� �����������

Caller called

OOD

����

Page 49: CORBA tutorial Boston2003

49

31/0

3/0 3

Thales Air Traffic Management

Change management with OO reuse

� 0 ������� ����%����������������� ! ��������"������"������������"��������! �"������������������������������"������

� ���� ������

���������������������������� ����

Caller called

No changes����

OOD

Page 50: CORBA tutorial Boston2003

50

31/0

3/0 3

Thales Air Traffic Management

With OOD : Software Bus

�������������������

Page 51: CORBA tutorial Boston2003

51

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 52: CORBA tutorial Boston2003

52

31/0

3/0 3

Thales Air Traffic Management

Changes example : the printer

Client Printing Server

From The CORBA BibleMichi HenningSteve VinoskiAdvanced CORBA Programming with C++

Page 53: CORBA tutorial Boston2003

53

31/0

3/0 3

Thales Air Traffic Management

Changes example : the printer

� 3 ������������"��"����&�������������#������"���#������ ��������������(�"���

� ���������#�����#�! ����������������"%�����! ������������������

� ��#�(�����������������������'��������! ������"�����#���(��(��?-��"%��@ ���������! ������"�����#��! ��"�����! ���������������! �"��������������

Page 54: CORBA tutorial Boston2003

54

31/0

3/0 3

Thales Air Traffic Management

Changes example : the printer

Client Printing Server

Page 55: CORBA tutorial Boston2003

55

31/0

3/0 3

Thales Air Traffic Management

Changes example : the printer

Old Client Printing Server

New Client

Page 56: CORBA tutorial Boston2003

56

31/0

3/0 3

Thales Air Traffic Management

Change management with OOD reuse

� ���������#�����#�! ����������������"%�����! ������������������

����������� �����������

������������� ������ ��

Client Printing Server

Page 57: CORBA tutorial Boston2003

57

31/0

3/0 3

Thales Air Traffic Management

Change management with OOD reuse

� 3 ���! ������"�����#���(��(��?-��"%��@ ���������! ������"�����#��! ��"�����! ���������������! �"��������������

� ���� ������

����������� ��

Client Printing Server

Page 58: CORBA tutorial Boston2003

58

31/0

3/0 3

Thales Air Traffic Management

Change management and code reuse before OOD

� � ����������������������������"����������������"���#�����"�����������! ������������(����������"��"���#����

� ���� ������

����������� ��

Page 59: CORBA tutorial Boston2003

59

31/0

3/0 3

Thales Air Traffic Management

Change management with OOD reuse

� ������#����?��)�"�@ �������"�������������������! ��"���"���#�����������������(����������"����������������

� ���� ������

����������� ��

�������

Page 60: CORBA tutorial Boston2003

60

31/0

3/0 3

Thales Air Traffic Management

Object properties

� ?��)�"�@ ���������������! ��#����������������������������������

� 2�"�����������

� ������"���

� ��������"��

� ��������������

� 2&"��������������#�

� ������������ ����������������"�����������"�����"�������������������! ��������#�������"���#���

Page 61: CORBA tutorial Boston2003

61

31/0

3/0 3

Thales Air Traffic Management

CORBA = Distributed Polymorphism

� ����)�"��������������#������#�����"������������#�������������������

� 0 ������ �������� �����#������������������������������

��� ����������)�"��+ ��(�"���.�+ /���������������������������������������������������������

Page 62: CORBA tutorial Boston2003

62

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 63: CORBA tutorial Boston2003

63

31/0

3/0 3

Thales Air Traffic Management

CORBA Distributed Polymorphism examples

� 2&�������

� ��������! ������ ���+ �8 ����#����(�"�

� 2&������C

� ���������������#��� ���+ �$�����"�������������"����"�������������.1 ��/

� 2&������D

� ����������������������������#���������������

Page 64: CORBA tutorial Boston2003

64

31/0

3/0 3

Thales Air Traffic Management

Example UML Diagram

Strip

Strip : stringPrint()Strip : stringPrint()

Printer

Print()Print()

Print

1

ColorPrinter

Setcolor()Setcolor()

From The CORBA BibleMichi HenningSteve VinoskiAdvanced CORBA Programming with C++

Page 65: CORBA tutorial Boston2003

65

31/0

3/0 3

Thales Air Traffic Management

Example Interface Inheritance (IDL)

���������������������������������������� ���������� ���������� ���������� ������ ���� ������ ������ ������ ������ ����

������������������������������������������������ ����������������������������������������������������������������������������������������������������

���������������� ������������������������������������ �� �� �� �������!�������!�������!�������!�� ����"�����"�����"�����"�

��������

Printer

ColorPrinter

������������������������������������ ������ ������ ������ ������ ����

���������������� #���� "�#���� "�#���� "�#���� "�

��������

Page 66: CORBA tutorial Boston2003

66

31/0

3/0 3

Thales Air Traffic Management

printer

Printer

print()

������������

Colour

set_color()

Page 67: CORBA tutorial Boston2003

67

31/0

3/0 3

Thales Air Traffic Management

printer

Printer

print()

������������

Page 68: CORBA tutorial Boston2003

68

31/0

3/0 3

Thales Air Traffic Management

������� ��

CORBA Distributed Polymorphism example 1

����� ��������������������

�������� ��

��� ��� ��

0 ���� ����� ��

-��&

8 ����#+ ��(�"�

Printer

Page 69: CORBA tutorial Boston2003

69

31/0

3/0 3

Thales Air Traffic Management

CORBA = Distributed Polymorphism

� �� ��?�����#����(�"�@ ��������������������������������������"���������"��

� ��������������������#����(�"�����#�������#�"����""���������������

� ������������8 ����#�+ ��(�"�����(���������! �"������#���! ����"������������������#����(�"��

Page 70: CORBA tutorial Boston2003

70

31/0

3/0 3

Thales Air Traffic Management

Objet Reference and Naming

Client NamingService

Server

Server exportsIOR

Client lookup for Interface IOR

Client submits request to server

Page 71: CORBA tutorial Boston2003

71

31/0

3/0 3

Thales Air Traffic Management

CORBA = Distributed Polymorphism

� ��������%���������������� �����������������������������

� � ����! ���������������(�����������"�������"���#���������������� ������������"�������

� 8 �! �"�������"����������������������! ����"����������! �������������"������ �������"�������

Page 72: CORBA tutorial Boston2003

72

31/0

3/0 3

Thales Air Traffic Management

������� ����� ��

CORBA = Distributed Polymorphism

����� �������

�������� ��

��� ��� ��

0 ���� ����� ��

-��&

8 ����#+ ��(�"�

�������������

ColorPrinter

Printer+ �"������! � "�����#

��"%�����0 ���������

Page 73: CORBA tutorial Boston2003

73

31/0

3/0 3

Thales Air Traffic Management

������� ����� ��

CORBA Distributed Polymorphism

����� �������

�������� ��

��� ��� ��

0 ���� ����� ��

-��&

8 ����#+ ��(�"�

�������������

ColorPrinter

Printer+ �"������! � "�����#

����������

Page 74: CORBA tutorial Boston2003

74

31/0

3/0 3

Thales Air Traffic Management

printer

Printer

print()

������������

Colour

set_color()

Page 75: CORBA tutorial Boston2003

75

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 76: CORBA tutorial Boston2003

76

31/0

3/0 3

Thales Air Traffic Management

We need design patterns

� 0 ����(�������������� ����������������������������������������������#�����������"����������"����-������������������#���

� ����#��������������������������������������������������"����������"��! ��"���������"���#���! �������"���������������"��

� �� ����������������������! ����%��! ���������������)�"�����������������#������#�

Page 77: CORBA tutorial Boston2003

77

31/0

3/0 3

Thales Air Traffic Management

Distributed Pattern

� �������#�����#����������.1 ���/������)�"��������������+ ������

� ����#���������� ���������)�"��+ ���! ��������#� ! ��"�����(�����"���#�����������"������������������������

� 2&����� ��"���� ��������! ��"��"��������������"��)��"�����! ����+ ���� �������

� �������&��������������! ������������������"������������

� + �"�����&���������#��������������! ������������������"������������

� � ������&���������#��������������! �����������������

Page 78: CORBA tutorial Boston2003

78

31/0

3/0 3

Thales Air Traffic Management

The GOF Abstract Factory Design Pattern

*GoF stand for Gang of Four. It refers to the famous books of John Vlissides, Erich Gamma, Richard Helm, Ralph Johnson. Design Patterns: Elements of Reusable Object-Oriented Software.

Page 79: CORBA tutorial Boston2003

79

31/0

3/0 3

Thales Air Traffic Management

Polymorphism and Factory Pattern : example 2

����� ��������������������

�������� �����������"����

Page 80: CORBA tutorial Boston2003

80

31/0

3/0 3

Thales Air Traffic Management

Life cycle

Printer FactoryClient Printer

Create Printer

Create Printer

Request

Printer IOR

Page 81: CORBA tutorial Boston2003

81

31/0

3/0 3

Thales Air Traffic Management

FACTOY PATTERN (from OOC training)

� � �����"�������������"�������������������! ����(��������������������'���"�����#����������! ��#

� + �"�����

� A client is required to provide security information before the factory object will allow the client to have access to another object.

� $���*�����"��#

� The factory object manages a pool of objects, often representing some limited resource, and assigns them to clients based on some utilization algorithm.

� ������������

� A factory object enables the use of polymorphism by returning object references to different implementations depending on the criteria specified by a client.

Page 82: CORBA tutorial Boston2003

82

31/0

3/0 3

Thales Air Traffic Management

Polymorphism and Factory Pattern

����� ��������������������

�������� �����������"����

Page 83: CORBA tutorial Boston2003

83

31/0

3/0 3

Thales Air Traffic Management

Polymorphism and Factory Pattern

����� ��������������������

�������� �����������"����

Page 84: CORBA tutorial Boston2003

84

31/0

3/0 3

Thales Air Traffic Management

Factory And Code Generation

Printer

+print()

Black & White

+ print()

������������

Page 85: CORBA tutorial Boston2003

85

31/0

3/0 3

Thales Air Traffic Management

Factory And Code Generation

Printer

+print()

������������

Black & White

+ print()

Colour

+ print()

Page 86: CORBA tutorial Boston2003

86

31/0

3/0 3

Thales Air Traffic Management

Factory And Code Generation

Printer

+print()

Black & White

+ print()

������ ������

Colour

+ print()

FAX

+ print()

Page 87: CORBA tutorial Boston2003

87

31/0

3/0 3

Thales Air Traffic Management

Factory And Code Generation

Printer

+print()

Black & White

+ print()

������ ������

Colour

+ print()

FAX

+ print()

Strip

+ print()

Page 88: CORBA tutorial Boston2003

88

31/0

3/0 3

Thales Air Traffic Management

Factory And Code Generation

<<Interface>>Printer

+print()

Black & White

+ print()

������ ������

Colour

+ print()

FAX

+ print()

Strip

+ print()

Page 89: CORBA tutorial Boston2003

89

31/0

3/0 3

Thales Air Traffic Management

Factory And Code Generation

<<Interface>>Printer Factory

Black & WhiteFactory

������������

1 �������������������"�����

ColourFactory

FAXFactory

StripFactory

Page 90: CORBA tutorial Boston2003

90

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 91: CORBA tutorial Boston2003

91

31/0

3/0 3

Thales Air Traffic Management

Why is procedural design expensive to change ?

� �"�������������"����������������������������"��������#����������������� ����������������������������������

� � ��������������"����������������"��������������������

� + ��! ����������������"���#�����������"�������������������"���#���

Page 92: CORBA tutorial Boston2003

92

31/0

3/0 3

Thales Air Traffic Management

Why is OOD easy to change ?

� �"����������)�"���������������#� ��������"������������������������������"���������������������

� 2�"����)�"���������������������������

� � ������������������������"���������#�����������������������)�"��

� � ������������������������������)�"��"������������ �"�����

Page 93: CORBA tutorial Boston2003

93

31/0

3/0 3

Thales Air Traffic Management

Object collaboration

Page 94: CORBA tutorial Boston2003

94

31/0

3/0 3

Thales Air Traffic Management

Why is OOD easy to change ?

� + ��! ����������������"���#���������������������������! ������)�"��"���#�� ����������������! ����������

� � ���"���������"����)�"����������������������"���#��������������������������

� ����"���#����������������"��#��������������������������������������?����@

Page 95: CORBA tutorial Boston2003

95

31/0

3/0 3

Thales Air Traffic Management

Example 3: The problem is in the User Input

Exit Coordination State

A: NIL_EXIT_STATE,B: FLIGHT_ACTIVATION_PROPOSAL,C: FLIGHT_ACTIVATION_ALARM,D: FLIGHT_ACTIVATION_CONFIRMED,E: HANDOVER_TRANSFERED,F: COORDINATION_TERMINATED,G: UNKNOWN_EXIT_STATE

Enter Exit Coordination State =>

Page 96: CORBA tutorial Boston2003

96

31/0

3/0 3

Thales Air Traffic Management

Replace case and enum by object .

enum ExitCoordinationState {

NIL_EXIT_STATE,FLIGHT_ACTIVATION_PROPOSAL,FLIGHT_ACTIVATION_ALARM,FLIGHT_ACTIVATION_CONFIRMED,HANDOVER_TRANSFERED,COORDINATION_TERMINATED,UNKNOWN_EXIT_STATE

}

Page 97: CORBA tutorial Boston2003

97

31/0

3/0 3

Thales Air Traffic Management

Example of structural fragility : the switch

� + ���"������+ ! ��"�����������������������"���#��

� 2(���������������������������"���#������"���#��"�������"������#�������������! �������������������! ��"�

� ��� �����"�������"�������! ��"� ���������������

� ��� �������������#���%�������"���#������"��E

� 2(���! ���� ������(�������"�����""�����#��������������(����'�������(������! ��"���""�����#��������������(�����

� 0 ���������������������(�����"���#���������(�����"���#���(���! ����������! ��"��"����

Page 98: CORBA tutorial Boston2003

98

31/0

3/0 3

Thales Air Traffic Management

structural switch

static void printsStatus(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

Page 99: CORBA tutorial Boston2003

99

31/0

3/0 3

Thales Air Traffic Management

structural switch

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

Page 100: CORBA tutorial Boston2003

100

31/0

3/0 3

Thales Air Traffic Management

structural switch

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(intstatus) {

switch(status) {

case NIL_EXIT_STATE: processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

SoftwareModule A

SoftwareModule B

SoftwareModule C

SoftwareModule D

SoftwareModule E

Page 101: CORBA tutorial Boston2003

101

31/0

3/0 3

Thales Air Traffic Management

The problem space and the solution space.

� �������! ��"��(����������"��������������������&������������������

� 0 ���������������-�������! �"����������(�����"���#���(���! ������������������! ��"��(�����

Page 102: CORBA tutorial Boston2003

102

31/0

3/0 3

Thales Air Traffic Management

User Imput

Exit Coordination State

A: NIL_EXIT_STATE,B: FLIGHT_ACTIVATION_PROPOSAL,C: FLIGHT_ACTIVATION_ALARM,D: FLIGHT_ACTIVATION_CONFIRMED,E: HANDOVER_TRANSFERED,F: COORDINATION_TERMINATED,G: NewStateH: UNKNOWN_EXIT_STATE

Enter Exit Coordination State =>

Page 103: CORBA tutorial Boston2003

103

31/0

3/0 3

Thales Air Traffic Management

Replace case and enum by object .

enum ExitCoordinationState {

NIL_EXIT_STATE,FLIGHT_ACTIVATION_PROPOSAL,FLIGHT_ACTIVATION_ALARM,FLIGHT_ACTIVATION_CONFIRMED,HANDOVER_TRANSFERED,COORDINATION_TERMINATED,

NewState,

UNKNOWN_EXIT_STATE

}

Page 104: CORBA tutorial Boston2003

104

31/0

3/0 3

Thales Air Traffic Management

static void printsStatus(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case New_State,processing 7

case UNKNOWN_EXIT_STATEprocessing 8

} }

structural switch

Page 105: CORBA tutorial Boston2003

105

31/0

3/0 3

Thales Air Traffic Management

structural switch

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(intstatus) {

switch(status) {

case NIL_EXIT_STATE: processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

static void flightUpdate(int status) {

switch(status) {

case NIL_EXIT_STATE : processing 1

case FLIGHT_ACTIVATION_PROPOSAL:processing 2

case FLIGHT_ACTIVATION_ALARM:processing 3

case FLIGHT_ACTIVATION_CONFIRMED:processing 4

case HANDOVER_TRANSFERED,processing 5

case COORDINATION_TERMINATED,processing 6

case UNKNOWN_EXIT_STATEprocessing 7

} }

SoftwareModule A

SoftwareModule B

SoftwareModule C

SoftwareModule D

SoftwareModule E

Changes

Page 106: CORBA tutorial Boston2003

106

31/0

3/0 3

Thales Air Traffic Management

OOD hides the problem space

� 0 ����������%�������"���#������"���������"��������������������������������)�"���

� 3 �! �����0 �����������������

� � ������������0 ���

� � �������������3 �!

Page 107: CORBA tutorial Boston2003

107

31/0

3/0 3

Thales Air Traffic Management

Polymorphism

Status

+print()

NIL_EXIT_STATE

+ print()

Print()Client

FLIGHT_ACTIVATION_PROPOSAL

+ print()

FLIGHT_ACTIVATION_ALARM

+ print()

UNKNOWN_EXIT_STATE

+ print()

Page 108: CORBA tutorial Boston2003

108

31/0

3/0 3

Thales Air Traffic Management

Factory Pattern

Status

+print()

NIL_EXIT_STATE

+ print()

������ ������

FLIGHT_ACTIVATION_PROPOSAL

+ print()

FLIGHT_ACTIVATION_ALARM

+ print()

UNKNOWN_EXIT_STATE

+ print()

StatusFactory

+ create()

Page 109: CORBA tutorial Boston2003

109

31/0

3/0 3

Thales Air Traffic Management

Factory Pattern

� � ����! ��"�������! �����������������)�"����������"�����

� � �����"�����������������! ���)�"�����������#�������(���"������������#����! ��"��"���������������������#���"����

� � ���"��������! ������������������"�������)�"�������+ ������

� 2�"����������)�"��%��! ����! ��������#��"��������(�"�������������"����

Page 110: CORBA tutorial Boston2003

110

31/0

3/0 3

Thales Air Traffic Management

Factory pseudo code

static Status create(int status) {

switch(status) {

case NIL_EXIT_STATE : return status = new nil_exit_state();break;

case FLIGHT_ACTIVATION_PROPOSAL:return status = new flight_activation_proposal();break;

case FLIGHT_ACTIVATION_ALARM:return status = new flight_activation_alarm();break;

case FLIGHT_ACTIVATION_CONFIRMED:return status = new flight_activation_confirmed();break;

case HANDOVER_TRANSFERED,return status = new handover_transfered();break;

case COORDINATION_TERMINATED,return status = new coordination_terminated();break;

case UNKNOWN_EXIT_STATEreturn status = new unknown_exit_state();

} }

New Object

Page 111: CORBA tutorial Boston2003

111

31/0

3/0 3

Thales Air Traffic Management

Polymorphism and changes

Status

+print()

NIL_EXIT_STATE

+ print()

������ ������

FLIGHT_ACTIVATION_PROPOSAL

+ print()

FLIGHT_ACTIVATION_ALARM

+ print()

UNKNOWN_EXIT_STATE

+ print()

NEW_STATE

+ print()

No Changes

Page 112: CORBA tutorial Boston2003

112

31/0

3/0 3

Thales Air Traffic Management

Polymorphism and state patterns

� ��! ����(�������)�"��! ��"��������"���"���#� �����#������������������! ����(�����������������������������������""�����#����������)�"��������! ������������������������

� ��������+ ���� �(�����! ��"���(�������������������������)�"�����"���#��#

� ��������+ ���� "�������������)�"��������"����������������������������� ����������������������"��������(�"������

Page 113: CORBA tutorial Boston2003

113

31/0

3/0 3

Thales Air Traffic Management

State Pattern (from the GoF)

GoF stand for Gang of Four. It refers to the famous books of Vlisside and Co. Design Patterns: Elements of Reusable Object-Oriented Software.

Page 114: CORBA tutorial Boston2003

114

31/0

3/0 3

Thales Air Traffic Management

Object Programming

State2

Stat1

State4

+ ��������#���

State5

�����2&�������������+ ���� F

�������������

���� ��������� ����� �� ��

���� ��������� �����

���� ��������� ���� ����� ��

�� � � ������������

�� � �� ����� ������ �����

� ���� � �����������

G

Page 115: CORBA tutorial Boston2003

115

31/0

3/0 3

Thales Air Traffic Management

State Pattern

� ������������������������"����&����)�"������� �"������! ��"����������������)�"�

� � ���������������)�"���&�������������� ����� �'��#������"������%��! ����! ����� ���#�����������'�������! �������"�����"��������(�"��������

Page 116: CORBA tutorial Boston2003

116

31/0

3/0 3

Thales Air Traffic Management

Polymorphism

Status

+print()

NIL_EXIT_STATE

+ print()

������ ������

FLIGHT_ACTIVATION_PROPOSAL

+ print()

FLIGHT_ACTIVATION_ALARM

+ print()

UNKNOWN_EXIT_STATE

+ print()

Page 117: CORBA tutorial Boston2003

117

31/0

3/0 3

Thales Air Traffic Management

Polymorphism

status

+print()

NIL_EXIT_STATE

+ print()

������ ������

FLIGHT_ACTIVATION_PROPOSAL

+ print()

FLIGHT_ACTIVATION_ALARM

+ print()

UNKNOWN_EXIT_STATE

+ print()

Status

+print()

������

Context

Concrete state

Page 118: CORBA tutorial Boston2003

118

31/0

3/0 3

Thales Air Traffic Management

Coarse Grain Examples

� � ������&�� ���������(������� ���'�����"�������������� ������������"������������#�������"�����������"�� � ���������� �

� � "������'�������������#�����(������������)�"����������#�������������������� �

� � �������&�� ���������"������#������&�� ����

� + ����� �! ����� � � ���)�"������"������#�������)�"��

Page 119: CORBA tutorial Boston2003

119

31/0

3/0 3

Thales Air Traffic Management

On line coordination with CORBA Objects

Air Traffic Control Centre

Status

Status

Status

Status

Page 120: CORBA tutorial Boston2003

120

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 121: CORBA tutorial Boston2003

121

31/0

3/0 3

Thales Air Traffic Management

CORBA = Coarse Grain Object

Remote ObjectLocal Object

Operation1()

Operation2()

Operation3()

Operation4()

Fine Grain Object

NO

Page 122: CORBA tutorial Boston2003

122

31/0

3/0 3

Thales Air Traffic Management

CORBA = Coarse Grain Object

Remote ObjectLocal Object

GroupOperation()YES

Page 123: CORBA tutorial Boston2003

123

31/0

3/0 3

Thales Air Traffic Management

Distributed Object Patterns

FaçadeLocal Object

Operation1()

Operation2()

Operation3()

Remote Object

GetRemoteObject()

��H����� ���$�"����"��

Page 124: CORBA tutorial Boston2003

124

31/0

3/0 3

Thales Air Traffic Management

Object By Value

Local Object

Operation1()

Operation2()

Operation3()

Remote Object

OBV

Event Factory

new

Event Type

$�"���� �)�"��

Page 125: CORBA tutorial Boston2003

125

31/0

3/0 3

Thales Air Traffic Management

3 1/0

3/03

CORBA use case

� Can we use CORBA in Large Distributed Control System ?

� What do We want !� Complex System Seamless Integration

� Why CORBA ?� Object Software Bus

� Design for changes� Change example : Printer� CORBA distributed polymorphism example� CORBA and Distributed Design pattern example� Procedural design versus Object design � Designing Distributed Object� Normalisation processes

Page 126: CORBA tutorial Boston2003

126

31/0

3/0 3

Thales Air Traffic Management

Separation Of Concern

FaultTolerance

Printer

LoadBalancing

Printer

Transaction

Printer

Security

Printer

Page 127: CORBA tutorial Boston2003

127

31/0

3/0 3

Thales Air Traffic Management

Separation Of Concern

� ������"�����������"����������������������! ��(��#������� ��������"��������"���"�������"��

� � ������������ ��������������"���������)�"�

� � ������������ �������������������������)�"�

� � ������������ ��������"������)�"��

� � ������������ �������������"�����)�"�

� � ���"�������������������������� ��������"��������! �������������"���"��������������������������� ���)�"���������������� ����"�������

Page 128: CORBA tutorial Boston2003

128

31/0

3/0 3

Thales Air Traffic Management

Separation Of Concern

SecurityLoad

Balancing

Printer

TransactionFault

Tolerance

Page 129: CORBA tutorial Boston2003

129

31/0

3/0 3

Thales Air Traffic Management

Separation Of Concern

Security LoadBalancing

Printer

TransactionFault

Tolerance

Page 130: CORBA tutorial Boston2003

130

31/0

3/0 3

Thales Air Traffic Management

Separation Of Concern

SecurityLoad

BalancingPrinter Transaction

FaultTolerance

Domain Services

TechnicalServices

Page 131: CORBA tutorial Boston2003

131

31/0

3/0 3

Thales Air Traffic Management

Y development cycle

������� �������� ������� �������������

�� ��� ���

�������������"�$���� ����"��#���������"�� �����"������

1 �����"�� �����! ���

������!����

Page 132: CORBA tutorial Boston2003

132

31/0

3/0 3

Thales Air Traffic Management

Application Lay out

� ����"������$�#�"

����� �"���-��

Page 133: CORBA tutorial Boston2003

133

31/0

3/0 3

Thales Air Traffic Management

� ����"������$�#�"

����� �"���-��

� ����"������$�#�"

Application Lay out

� ����"������� �"���-��

Page 134: CORBA tutorial Boston2003

134

31/0

3/0 3

Thales Air Traffic Management

Application Lay out

� ����"������$�#�"

� ����"������� �"���-��

� ����"������ �"����"��

� �"���"���� �"����"��

Page 135: CORBA tutorial Boston2003

135

31/0

3/0 3

Thales Air Traffic Management

Y Standardization Process

� ������"�����������"����"����#�������! �������������� ��������#�

� � �"���"������������(�����#�����"�� �����! ��������"�������������"���"���������

� � �� ����� �������������������������"���"��������������������������� �

� 0 ����(�����! �����"%���(����� ������������ ���A���������"����

Page 136: CORBA tutorial Boston2003

136

31/0

3/0 3

Thales Air Traffic Management

Y Standardization Process

������� �������� ������� �������������

Domain Logic Patterns

Domain TechnicalPatterns

Transportation DTF