corba tutorial boston2003
DESCRIPTION
CORBA tutorialTRANSCRIPT
CORBA for transportation control and command systems tutorial
������������ ���������������������������
2
31/0
3/0 3
Thales Air Traffic Management
CORBA ATC use case, Note to offline reader.
� �������������������������������� ���������������������������� ������������������������������������������������ ������ ��! ����������������������"��������#�����������! ������������������������! ���������� ��������#��������������"�������#��������
$�%����#��������"����������"��! ��! ���������&�������� �'�������� (���������������� ��������)�"�������������"�����#���������#��������������"���������������
� ���%�������"���������&������! �����������������������(��������#��� ����������������#�! �����&����! �������*��)�"����"�����#����
���"��������������! ������"�����������#���������������������! ����! ��%��! �! ����! ����������! ���"�����#��� ���! ����(�����%��! ����������������������#�������������
� ���������������������"����"���'��������#������"��������������������(����(������������"���'�������������"�������������������������"�����#�������������������������#������������������"������������������"�������%��! ���#��
3
31/0
3/0 3
Thales Air Traffic Management
The open issue :
����� �������������$��#���������������������+ ��������"���������� �����"��������+ ������,�
,
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
5
31/0
3/0 3
Thales Air Traffic Management
Why CORBA ?
� ��)�"����"�����#���(��"���������"������������! ������(�����������������(�����#����-������������"����������������
. ���������������������/
� 0 ��! �������������)�"��������������� �"�����#��� ���(��"���������"�����������#������������������! ������(�����������������(�����#����-������������"���������������
� �� �����(�������������������)�"��������������
6
31/0
3/0 3
Thales Air Traffic Management
Practical Use Case
� 0 ������#���#����������! ��� ��������
� + ������+ �������� ���#������
� 1 ��"�����+ ���������������"������2(�������
���������! ��%�,
� 3 �! ������������! ��%�,
� 0 ���� ������������(���� ,
� 2&�������
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
�����
8
31/0
3/0 3
Thales Air Traffic Management
Object At system level ?
� � ���-������������"���! ����������)�"����"�����#������������������(���,
� ���! �������� ��(��"������"���������! �����������! ������������)�"��,
� � ������! ������
7 ��� ���������(����������������! ����������������#�������'�! ��������������)�"���������������#��(�����������
�� �������! �������(������������������
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
10
31/0
3/0 3
Thales Air Traffic Management
What Do We Want
� �����&�+ �������+ �������� ���#��������������������"�
� ����#������"���#��
11
31/0
3/0 3
Thales Air Traffic Management
�����
��++ ��
��"�����#
What Do We Want !
Supervision
OperatorDisplaySystem
12
31/0
3/0 3
Thales Air Traffic Management
���#������#�����
�����
��++ ��
��"�����#
��"�����# �����
��++ ��
What DO We Want !
Supervision
OperatorDisplaySystem
13
31/0
3/0 3
Thales Air Traffic Management
���#������#�����
��"�����# �����
��++ ��
What DO We Want !
Supervision
OperatorDisplaySystem
14
31/0
3/0 3
Thales Air Traffic Management
We want to Increase Integrated software quality
��������������� ��� ���� ��������� ������ ��
������� ������ ��� ���������� ������� ���������
��� � ��
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
16
31/0
3/0 3
Thales Air Traffic Management
What We expect ?
0 ��! ���������
���#������#�����
��"�����# �����
��++ ��
Supervision
OperatorDisplaySystem
17
31/0
3/0 3
Thales Air Traffic Management
What We expect ?
8 ���� ����
+ ��#�����������
18
31/0
3/0 3
Thales Air Traffic Management
What We May Have :
+ ��(�"���+ ��(�"��
+ ��(�"���
+ ��(�"�� �
+ ��(�"��2
19
31/0
3/0 3
Thales Air Traffic Management
Spaghetti Plate Syndrome
8 ����������������
�����"���
20
31/0
3/0 3
Thales Air Traffic Management
Spaghetti Plate Syndrome
+ ��#�����������
+ ��������"����"�
21
31/0
3/0 3
Thales Air Traffic Management
Spaghetti Plate Syndrome
+ ��#�����������
+ ������ ���#�����
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
23
31/0
3/0 3
Thales Air Traffic Management
Why CORBA
� 0 �������������������������! ��������
� ��������(����(�������������! ����"�������������#�����������! ������
� ��)�"� + ���! ���� ���
� ��)�"����������������������"����������������������#�������
� 0 ���������)�"�'�"�������������#������������������(���(��������"�������������������������"���������
24
31/0
3/0 3
Thales Air Traffic Management
Software Component Integration Bus
Software BUS
25
31/0
3/0 3
Thales Air Traffic Management
Object Software Component Integration Bus
���"������
��)�"�
������#�
��
�� �99:; �(�
������! ���$��#��#�
DistributedPolymorphism
Software Components Evolution
And Replacement
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
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.
28
31/0
3/0 3
Thales Air Traffic Management
Object Software Component Integration Bus
Object Software BUS
29
31/0
3/0 3
Thales Air Traffic Management
Object Software Component Integration Bus
Object Software BUS
8 �! ���������
30
31/0
3/0 3
Thales Air Traffic Management
Procedural versus Object
Procedural Design Object Design
Before Object After Object
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
32
31/0
3/0 3
Thales Air Traffic Management
Design for changes
� 0 ��"��>���(����?"���#��@
� 0 ����(������������������"���#�������������#�
� �����������������������A���(�������#�������������(��������
� 0 ������������(����������������"�����"���#�
� 0 ��"��>������A������������-�����������������(������#�����#
� ���&���������#���������"���#��
� ���#�������(�������
� � ���������������������������"���#�
33
31/0
3/0 3
Thales Air Traffic Management
� ��-����������
� ������������"�(���0 ����������������0 ���������#�����������2���������(���������
� � �"�����#�
� ���������"������� �"������#�0 ����� ���
� + %���
� 0 ��$���������B ��������������������������0 �����"�(���������#���+ ���������������; ��
� + ������ ����������"
� 8 ���������
<.�����������������������! ���/
Changes Sources* During Development
34
31/0
3/0 3
Thales Air Traffic Management
Object Oriented Design
� ���#�������������#���! �"������������"��#��&�����#�"����! ������! �"����
� ��)�"���������������#� .���/����"���-����.������������/�������������"��#�"�������������#�"����! �������"���#��#������&�����#�"����
� 0 �������
� ����"����"���"������! �"����! �������"���#�
� 0 ����������
� ����"����"�������"������! �"���
35
31/0
3/0 3
Thales Air Traffic Management
Without OOD
Without OOD
Design for no Changes
Stationary System
36
31/0
3/0 3
Thales Air Traffic Management
Change management before OOD
� �����#�(�������������������"����������������������(��������
� � ���������������������"�����#�����������"�����������
����������� �����������
Caller called
37
31/0
3/0 3
Thales Air Traffic Management
Change management before OOD
� 0 �����������! ��������"������"������������"����������������������(����"���#����������"������"��������������#������������! �"������������"��������������������
������ � ����
Caller called
No changes
38
31/0
3/0 3
Thales Air Traffic Management
Change management before OOD
� ������������������! ����������'�! ��������"������"�������"���#�������"������"��������������"���#�������������������������! �"����
������ � ����
� ���� ������
Caller called
Changes
39
31/0
3/0 3
Thales Air Traffic Management
Change management and code reuse before OO
� ������������������! ����������'�! ��������"������"�������"���#�������"������"��������������"���#�������������������������! �"����
������ � ����
� ���� ������
������� ����
Caller called
40
31/0
3/0 3
Thales Air Traffic Management
System Integration is a specific change case
� + ����������#��������������������"�����"���#��"������������"��#�����"���������! �"�����
� 0 ��������! �"����������������#���������������������������������������-��(�����
� � ����! �"��������"�����#��������"��
� � ������"������������"�������������"��
���������������
�����������
���������������
Caller Called Caller Called
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
42
31/0
3/0 3
Thales Air Traffic Management
Pervasive Change
Replaced Module (Changed)
43
31/0
3/0 3
Thales Air Traffic Management
Pervasive Change
44
31/0
3/0 3
Thales Air Traffic Management
Pervasive Change
45
31/0
3/0 3
Thales Air Traffic Management
Pervasive Change
Several Changes Replace and Reused
46
31/0
3/0 3
Thales Air Traffic Management
Pervasive Change = Spaghetti Plate
+ ��#�����������
After Several Changes Replace and Reused
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
48
31/0
3/0 3
Thales Air Traffic Management
Change management with OO reuse
� 0 ������� ����%����������������� ! ��������"������"������������"��������! �"������������������������������"������
����������� �����������
Caller called
OOD
����
49
31/0
3/0 3
Thales Air Traffic Management
Change management with OO reuse
� 0 ������� ����%����������������� ! ��������"������"������������"��������! �"������������������������������"������
� ���� ������
���������������������������� ����
Caller called
No changes����
OOD
50
31/0
3/0 3
Thales Air Traffic Management
With OOD : Software Bus
�������������������
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
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++
53
31/0
3/0 3
Thales Air Traffic Management
Changes example : the printer
� 3 ������������"��"����&�������������#������"���#������ ��������������(�"���
� ���������#�����#�! ����������������"%�����! ������������������
� ��#�(�����������������������'��������! ������"�����#���(��(��?-��"%��@ ���������! ������"�����#��! ��"�����! ���������������! �"��������������
54
31/0
3/0 3
Thales Air Traffic Management
Changes example : the printer
Client Printing Server
55
31/0
3/0 3
Thales Air Traffic Management
Changes example : the printer
Old Client Printing Server
New Client
56
31/0
3/0 3
Thales Air Traffic Management
Change management with OOD reuse
� ���������#�����#�! ����������������"%�����! ������������������
����������� �����������
������������� ������ ��
Client Printing Server
57
31/0
3/0 3
Thales Air Traffic Management
Change management with OOD reuse
� 3 ���! ������"�����#���(��(��?-��"%��@ ���������! ������"�����#��! ��"�����! ���������������! �"��������������
� ���� ������
����������� ��
Client Printing Server
58
31/0
3/0 3
Thales Air Traffic Management
Change management and code reuse before OOD
� � ����������������������������"����������������"���#�����"�����������! ������������(����������"��"���#����
� ���� ������
����������� ��
59
31/0
3/0 3
Thales Air Traffic Management
Change management with OOD reuse
� ������#����?��)�"�@ �������"�������������������! ��"���"���#�����������������(����������"����������������
� ���� ������
����������� ��
�������
60
31/0
3/0 3
Thales Air Traffic Management
Object properties
� ?��)�"�@ ���������������! ��#����������������������������������
� 2�"�����������
� ������"���
� ��������"��
� ��������������
� 2&"��������������#�
� ������������ ����������������"�����������"�����"�������������������! ��������#�������"���#���
61
31/0
3/0 3
Thales Air Traffic Management
CORBA = Distributed Polymorphism
� ����)�"��������������#������#�����"������������#�������������������
� 0 ������ �������� �����#������������������������������
��� ����������)�"��+ ��(�"���.�+ /���������������������������������������������������������
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
63
31/0
3/0 3
Thales Air Traffic Management
CORBA Distributed Polymorphism examples
� 2&�������
� ��������! ������ ���+ �8 ����#����(�"�
� 2&������C
� ���������������#��� ���+ �$�����"�������������"����"�������������.1 ��/
� 2&������D
� ����������������������������#���������������
64
31/0
3/0 3
Thales Air Traffic Management
Example UML Diagram
Strip
Strip : stringPrint()Strip : stringPrint()
Printer
Print()Print()
1
ColorPrinter
Setcolor()Setcolor()
From The CORBA BibleMichi HenningSteve VinoskiAdvanced CORBA Programming with C++
65
31/0
3/0 3
Thales Air Traffic Management
Example Interface Inheritance (IDL)
���������������������������������������� ���������� ���������� ���������� ������ ���� ������ ������ ������ ������ ����
������������������������������������������������ ����������������������������������������������������������������������������������������������������
���������������� ������������������������������������ �� �� �� �������!�������!�������!�������!�� ����"�����"�����"�����"�
��������
Printer
ColorPrinter
������������������������������������ ������ ������ ������ ������ ����
���������������� #���� "�#���� "�#���� "�#���� "�
��������
66
31/0
3/0 3
Thales Air Traffic Management
printer
Printer
print()
������������
Colour
set_color()
67
31/0
3/0 3
Thales Air Traffic Management
printer
Printer
print()
������������
68
31/0
3/0 3
Thales Air Traffic Management
������� ��
CORBA Distributed Polymorphism example 1
����� ��������������������
�������� ��
��� ��� ��
0 ���� ����� ��
-��&
8 ����#+ ��(�"�
Printer
69
31/0
3/0 3
Thales Air Traffic Management
CORBA = Distributed Polymorphism
� �� ��?�����#����(�"�@ ��������������������������������������"���������"��
� ��������������������#����(�"�����#�������#�"����""���������������
� ������������8 ����#�+ ��(�"�����(���������! �"������#���! ����"������������������#����(�"��
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
71
31/0
3/0 3
Thales Air Traffic Management
CORBA = Distributed Polymorphism
� ��������%���������������� �����������������������������
� � ����! ���������������(�����������"�������"���#���������������� ������������"�������
� 8 �! �"�������"����������������������! ����"����������! �������������"������ �������"�������
72
31/0
3/0 3
Thales Air Traffic Management
������� ����� ��
CORBA = Distributed Polymorphism
����� �������
�������� ��
��� ��� ��
0 ���� ����� ��
-��&
8 ����#+ ��(�"�
�������������
ColorPrinter
Printer+ �"������! � "�����#
��"%�����0 ���������
73
31/0
3/0 3
Thales Air Traffic Management
������� ����� ��
CORBA Distributed Polymorphism
����� �������
�������� ��
��� ��� ��
0 ���� ����� ��
-��&
8 ����#+ ��(�"�
�������������
ColorPrinter
Printer+ �"������! � "�����#
����������
74
31/0
3/0 3
Thales Air Traffic Management
printer
Printer
print()
������������
Colour
set_color()
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
76
31/0
3/0 3
Thales Air Traffic Management
We need design patterns
� 0 ����(�������������� ����������������������������������������������#�����������"����������"����-������������������#���
� ����#��������������������������������������������������"����������"��! ��"���������"���#���! �������"���������������"��
� �� ����������������������! ����%��! ���������������)�"�����������������#������#�
77
31/0
3/0 3
Thales Air Traffic Management
Distributed Pattern
� �������#�����#����������.1 ���/������)�"��������������+ ������
� ����#���������� ���������)�"��+ ���! ��������#� ! ��"�����(�����"���#�����������"������������������������
� 2&����� ��"���� ��������! ��"��"��������������"��)��"�����! ����+ ���� �������
� �������&��������������! ������������������"������������
� + �"�����&���������#��������������! ������������������"������������
� � ������&���������#��������������! �����������������
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.
79
31/0
3/0 3
Thales Air Traffic Management
Polymorphism and Factory Pattern : example 2
����� ��������������������
�������� �����������"����
80
31/0
3/0 3
Thales Air Traffic Management
Life cycle
Printer FactoryClient Printer
Create Printer
Create Printer
Request
Printer IOR
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.
82
31/0
3/0 3
Thales Air Traffic Management
Polymorphism and Factory Pattern
����� ��������������������
�������� �����������"����
83
31/0
3/0 3
Thales Air Traffic Management
Polymorphism and Factory Pattern
����� ��������������������
�������� �����������"����
84
31/0
3/0 3
Thales Air Traffic Management
Factory And Code Generation
Printer
+print()
Black & White
+ print()
������������
85
31/0
3/0 3
Thales Air Traffic Management
Factory And Code Generation
Printer
+print()
������������
Black & White
+ print()
Colour
+ print()
86
31/0
3/0 3
Thales Air Traffic Management
Factory And Code Generation
Printer
+print()
Black & White
+ print()
������ ������
Colour
+ print()
FAX
+ print()
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()
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()
89
31/0
3/0 3
Thales Air Traffic Management
Factory And Code Generation
<<Interface>>Printer Factory
Black & WhiteFactory
������������
1 �������������������"�����
ColourFactory
FAXFactory
StripFactory
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
91
31/0
3/0 3
Thales Air Traffic Management
Why is procedural design expensive to change ?
� �"�������������"����������������������������"��������#����������������� ����������������������������������
� � ��������������"����������������"��������������������
� + ��! ����������������"���#�����������"�������������������"���#���
92
31/0
3/0 3
Thales Air Traffic Management
Why is OOD easy to change ?
� �"����������)�"���������������#� ��������"������������������������������"���������������������
� 2�"����)�"���������������������������
� � ������������������������"���������#�����������������������)�"��
� � ������������������������������)�"��"������������ �"�����
93
31/0
3/0 3
Thales Air Traffic Management
Object collaboration
94
31/0
3/0 3
Thales Air Traffic Management
Why is OOD easy to change ?
� + ��! ����������������"���#���������������������������! ������)�"��"���#�� ����������������! ����������
� � ���"���������"����)�"����������������������"���#��������������������������
� ����"���#����������������"��#��������������������������������������?����@
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 =>
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
}
97
31/0
3/0 3
Thales Air Traffic Management
Example of structural fragility : the switch
� + ���"������+ ! ��"�����������������������"���#��
� 2(���������������������������"���#������"���#��"�������"������#�������������! �������������������! ��"�
� ��� �����"�������"�������! ��"� ���������������
� ��� �������������#���%�������"���#������"��E
� 2(���! ���� ������(�������"�����""�����#��������������(����'�������(������! ��"���""�����#��������������(�����
� 0 ���������������������(�����"���#���������(�����"���#���(���! ����������! ��"��"����
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
} }
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
} }
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
101
31/0
3/0 3
Thales Air Traffic Management
The problem space and the solution space.
� �������! ��"��(����������"��������������������&������������������
� 0 ���������������-�������! �"����������(�����"���#���(���! ������������������! ��"��(�����
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 =>
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
}
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
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
106
31/0
3/0 3
Thales Air Traffic Management
OOD hides the problem space
� 0 ����������%�������"���#������"���������"��������������������������������)�"���
� 3 �! �����0 �����������������
� � ������������0 ���
� � �������������3 �!
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()
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()
109
31/0
3/0 3
Thales Air Traffic Management
Factory Pattern
� � ����! ��"�������! �����������������)�"����������"�����
� � �����"�����������������! ���)�"�����������#�������(���"������������#����! ��"��"���������������������#���"����
� � ���"��������! ������������������"�������)�"�������+ ������
� 2�"����������)�"��%��! ����! ��������#��"��������(�"�������������"����
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
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
112
31/0
3/0 3
Thales Air Traffic Management
Polymorphism and state patterns
� ��! ����(�������)�"��! ��"��������"���"���#� �����#������������������! ����(�����������������������������������""�����#����������)�"��������! ������������������������
� ��������+ ���� �(�����! ��"���(�������������������������)�"�����"���#��#
� ��������+ ���� "�������������)�"��������"����������������������������� ����������������������"��������(�"������
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.
114
31/0
3/0 3
Thales Air Traffic Management
Object Programming
State2
Stat1
State4
+ ��������#���
State5
�����2&�������������+ ���� F
�������������
���� ��������� ����� �� ��
���� ��������� �����
���� ��������� ���� ����� ��
�� � � ������������
�� � �� ����� ������ �����
� ���� � �����������
G
115
31/0
3/0 3
Thales Air Traffic Management
State Pattern
� ������������������������"����&����)�"������� �"������! ��"����������������)�"�
� � ���������������)�"���&�������������� ����� �'��#������"������%��! ����! ����� ���#�����������'�������! �������"�����"��������(�"��������
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()
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
118
31/0
3/0 3
Thales Air Traffic Management
Coarse Grain Examples
� � ������&�� ���������(������� ���'�����"�������������� ������������"������������#�������"�����������"�� � ���������� �
� � "������'�������������#�����(������������)�"����������#�������������������� �
� � �������&�� ���������"������#������&�� ����
� + ����� �! ����� � � ���)�"������"������#�������)�"��
119
31/0
3/0 3
Thales Air Traffic Management
On line coordination with CORBA Objects
Air Traffic Control Centre
Status
Status
Status
Status
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
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
122
31/0
3/0 3
Thales Air Traffic Management
CORBA = Coarse Grain Object
Remote ObjectLocal Object
GroupOperation()YES
123
31/0
3/0 3
Thales Air Traffic Management
Distributed Object Patterns
FaçadeLocal Object
Operation1()
Operation2()
Operation3()
Remote Object
GetRemoteObject()
��H����� ���$�"����"��
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
$�"���� �)�"��
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
126
31/0
3/0 3
Thales Air Traffic Management
Separation Of Concern
FaultTolerance
Printer
LoadBalancing
Printer
Transaction
Printer
Security
Printer
127
31/0
3/0 3
Thales Air Traffic Management
Separation Of Concern
� ������"�����������"����������������������! ��(��#������� ��������"��������"���"�������"��
� � ������������ ��������������"���������)�"�
� � ������������ �������������������������)�"�
� � ������������ ��������"������)�"��
� � ������������ �������������"�����)�"�
� � ���"�������������������������� ��������"��������! �������������"���"��������������������������� ���)�"���������������� ����"�������
128
31/0
3/0 3
Thales Air Traffic Management
Separation Of Concern
SecurityLoad
Balancing
Printer
TransactionFault
Tolerance
129
31/0
3/0 3
Thales Air Traffic Management
Separation Of Concern
Security LoadBalancing
Printer
TransactionFault
Tolerance
130
31/0
3/0 3
Thales Air Traffic Management
Separation Of Concern
SecurityLoad
BalancingPrinter Transaction
FaultTolerance
Domain Services
TechnicalServices
131
31/0
3/0 3
Thales Air Traffic Management
Y development cycle
������� �������� ������� �������������
�� ��� ���
�������������"�$���� ����"��#���������"�� �����"������
1 �����"�� �����! ���
������!����
132
31/0
3/0 3
Thales Air Traffic Management
Application Lay out
� ����"������$�#�"
����� �"���-��
133
31/0
3/0 3
Thales Air Traffic Management
� ����"������$�#�"
����� �"���-��
� ����"������$�#�"
Application Lay out
� ����"������� �"���-��
134
31/0
3/0 3
Thales Air Traffic Management
Application Lay out
� ����"������$�#�"
� ����"������� �"���-��
� ����"������ �"����"��
� �"���"���� �"����"��
135
31/0
3/0 3
Thales Air Traffic Management
Y Standardization Process
� ������"�����������"����"����#�������! �������������� ��������#�
� � �"���"������������(�����#�����"�� �����! ��������"�������������"���"���������
� � �� ����� �������������������������"���"��������������������������� �
� 0 ����(�����! �����"%���(����� ������������ ���A���������"����
136
31/0
3/0 3
Thales Air Traffic Management
Y Standardization Process
������� �������� ������� �������������
Domain Logic Patterns
Domain TechnicalPatterns
Transportation DTF