Post on 14-Sep-2018
1http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Franco GasperoniFranco Gasperonigasperon@actgasperon@act--europe.freurope.frhttp://http://librelibre.act.act--europeeurope..frfr
2http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Copyright NoticeCopyright Notice
•• © ACT Europe under the GNU Free Documentation License© ACT Europe under the GNU Free Documentation License
•• Permission is granted to copy, distribute and/or modify this Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free License, Version 1.1 or any later version published by the Free Software Foundation; provided its original author is mentioned Software Foundation; provided its original author is mentioned and the link to http://and the link to http://librelibre.act.act--europeeurope..frfr/ is kept at the bottom of / is kept at the bottom of every nonevery non--title slide. A copy of the license is available at: title slide. A copy of the license is available at:
•• http://www.http://www.fsffsf.org/licenses/.org/licenses/fdlfdl.html.html
3http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
4http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• IntroductionIntroduction•• Distributed Distributed ProgProg. Paradigms. Paradigms•• Distributed Object TechnologiesDistributed Object Technologies•• ConclusionConclusion
5http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• NonNon--distributed applicationdistributed application = single process= single process–– running on a single computerrunning on a single computer
•• Distributed applicationDistributed application = several communicating = several communicating processesprocesses–– processes often run on different computers processes often run on different computers –– computers are connected through a networkcomputers are connected through a network
6http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
processprocess
Single Process ApplicationSingle Process Application
body
spec
main
body
spec
body
spec
7http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Distributed Application Distributed Application
body
spec
body
spec
body
spec
main
processprocessbody
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
ApplicationApplication
8http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
All Processes Can Run on the All Processes Can Run on the Same Computer Same Computer
body
spec
body
spec
body
spec
main
processprocessbody
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
9http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Or They can run on Different Or They can run on Different Computers Computers
body
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
10http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
In All Cases This Requires In All Cases This Requires InterInter--Process CommunicationProcess Communication
body
spec
body
spec
body
spec
main
processprocessbody
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
11http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
body
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
body
spec
body
spec
body
spec
main
processprocess
????
12http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
The Main Topic of this LectureThe Main Topic of this Lecture
•• How distributed processes communicate at How distributed processes communicate at the the programmingprogramming levellevel
•• How the “How the “software chunkssoftware chunks” of a distributed ” of a distributed app can app can interactinteract..
•• This lecture will NOT teach you how they This lecture will NOT teach you how they communicate at thecommunicate at the–– physical levelphysical level–– or protocol levelor protocol level
13http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Remember OSI Layers ?Remember OSI Layers ?
ApplicationApplication
PresentationPresentation
Transport
Network
Data Link
Physical
SessionSession
ApplicationApplication
PresentationPresentation
Transport
Network
Data Link
Physical
SessionSession } {This is whatThis is whatThis is whatThis is whatThis is whatThis is whatThis is whatThis is whatwe will look atwe will look atwe will look atwe will look atwe will look atwe will look atwe will look atwe will look at
14http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ApplicationApplication
PresentationPresentation
Transport
Network
Data Link
Physical
SessionSession
Telnet, ftp, …Sending data in platform indep. mannerEstablish communication bw processesTCP, UDP, ...
IP, X.25, ...
Network drivers
The wire
15http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Why Distributed Apps ?Why Distributed Apps ?
•• Multiuser Multiuser apps (e.g. eapps (e.g. e--mail, ftp)mail, ftp)•• Sharing data (e.g. www, airline reservation)Sharing data (e.g. www, airline reservation)•• Sharing resources (e.g. printers)Sharing resources (e.g. printers)•• Fault toleranceFault tolerance•• App may be inherently distributed (cell phones, App may be inherently distributed (cell phones,
ATM machines, …)ATM machines, …)
16http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Distributed Distributed ProgProg. Is Hard. Is Hard
•• Multiple failure modesMultiple failure modes–– each individual process can fail (bugs, machine crash..)each individual process can fail (bugs, machine crash..)–– the network can go ashtraythe network can go ashtray
•• Security issuesSecurity issues–– is someone else listeningis someone else listening
•• Testing & debuggingTesting & debugging•• Distributed Distributed progprog. technologies not fully mature. technologies not fully mature
–– interoperability is still an issueinteroperability is still an issue
17http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• IntroductionIntroduction•• Distributed Distributed ProgProg. Paradigms. Paradigms
–– Message Sending (Sockets)Message Sending (Sockets)–– Remote Procedure CallsRemote Procedure Calls–– Distributed ObjectsDistributed Objects
18http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
bodybody
processprocess
specspec
processprocess
??
How to Formalize the Notion of an How to Formalize the Notion of an Interface in a Distributed Environment ?Interface in a Distributed Environment ?
19http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
How to Formalize the Notion of an How to Formalize the Notion of an Interface in a Distributed Environment ?Interface in a Distributed Environment ?
•• Answer 1Answer 1: don’t formalize it, send a message: don’t formalize it, send a message–– e.g. socketse.g. sockets
•• Answer 2Answer 2: Remote Procedure Call (RPC): Remote Procedure Call (RPC)
•• Answer 3Answer 3: : RPCs RPCs + Distributed Objects+ Distributed Objects–– Language dependent: Ada 95, Java RMILanguage dependent: Ada 95, Java RMI–– Language independent: CORBA, COM/DCOMLanguage independent: CORBA, COM/DCOM
20http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
A Simple ComparisonA Simple Comparison
ObjectObject--OrientedOrientedProgrammingProgramming
Programming withProgramming withGOTOsGOTOs
StructuredStructuredProgrammingProgramming
Distributed ObjectsDistributed Objects
MessageMessage SendingSending((socketssockets))
RPCsRPCs
21http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Some TerminologySome Terminology
bodybodyspecspec
Client:Client:Client:Client:Client:Client:Client:Client: the code that madethe code that madethe request for servicethe request for service Server:Server:Server:Server:Server:Server:Server:Server: the code thatthe code that
answered the requestanswered the request
22http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Answer 1: Don’t Formalize ItAnswer 1: Don’t Formalize ItSend a Message (e.g. Sockets)Send a Message (e.g. Sockets)
Send (…, Bytes);Send (…, Bytes); ReceiveReceive (…, & Bytes [ ]);(…, & Bytes [ ]);
23http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Client ProcessClientClient ProcessProcess
time
Server ProcessServerServer ProcessProcess
time
Wait for connectionWait for connection
ComputeCompute
Send bytesSend bytes
Close socketClose socket
Open socketOpen socket
Get bytesGet bytes
Open socketOpen socket
ComputeCompute
Send bytesSend bytes
Wait for replyWait for reply
Close socketClose socket
Get bytesGet bytes
raw bytes
raw bytes
24http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
What are the problemsWhat are the problems
with this approach ?with this approach ?
25http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Problems with Problems with Sockets/Message SendingSockets/Message Sending
•• No interfaces No interfaces -- very lowvery low--level programminglevel programming–– does not scale updoes not scale up
•• Sockets exchange bytesSockets exchange bytes–– How do you exchange more complex data structures ?How do you exchange more complex data structures ?–– How do you handle heterogeneous systems ?How do you handle heterogeneous systems ?
26http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ClientClientClient
time
ServerServerServer
time
Answer requestAnswer request
ComputeComputeWait for replyWait for reply
ComputeCompute
Get responseGet response
Send requestSend requestdata
Send responseSend responsedata
Doesn’t this look familiar ?Doesn’t this look familiar ?Wait for requestWait for request
27http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Answer 2: Remote Procedure CallsAnswer 2: Remote Procedure Calls
R := R := Foo Foo (123);(123);
function function Foo Foo (X : Integer)(X : Integer)return Float; return Float;
28http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ClientClientClient
time
ServerServerServer
time
function function Foo Foo (X: Integer)(X: Integer)return Float return Float
isis……beginbegin
……return …;return …;
end end FooFoo;;
Wait for replyWait for reply
ComputeCompute
Get resultGet result
R := R := Foo Foo (123);(123);send parameters
send result or modified parameters
RPCRPC
29http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
RPCsRPCs
•• Remote procedureRemote procedure callcall completely handledcompletely handled byby thethesystemsystem
•• Parameters and results passed across theParameters and results passed across thenetworknetwork withoutwithout programmer interventionprogrammer intervention
•• Heterogeneity handled transparentlyHeterogeneity handled transparently
30http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Where is the Magic ?Where is the Magic ?
R := R := Foo Foo (123);(123);
function function Foo Foo (X : Integer)(X : Integer)return Float; return Float;
31http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Client Stub & Server SkeletonClient Stub & Server Skeleton•• From the server spec theFrom the server spec the systemsystem generatesgenerates a a
clientclient stubstub::–– MarshalsMarshals the parametersthe parameters–– Sends the request over theSends the request over the networknetwork–– WaitsWaits forfor the response and unmarshals the resultthe response and unmarshals the result
•• From the server specFrom the server spec ((and serverand server body)body) thethesystemsystem generatesgenerates aa server skeletonserver skeleton–– Receives theReceives the RPCRPC requestrequest–– unmarshals the parametersunmarshals the parameters–– SelectsSelects and calls the appropriate subprogramand calls the appropriate subprogram–– MarshalsMarshals the result and sends the responsethe result and sends the response
32http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
SpecialSpecialCompilerCompiler SpecialSpecial
CompilerCompiler
Stubs & SkeletonsStubs & Skeletons
function function Foo Foo (X : Integer)(X : Integer)return Float; return Float;
Client Stub Client Stub Server Skeleton Server Skeleton
function function Foo Foo (X: Integer)(X: Integer)return Float return Float
isis……
end end FooFoo;;
33http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
R := R := Foo Foo (123);(123);
function function Foo Foo (X : Integer)(X : Integer)return Float; return Float;
Client StubClient Stub Server Server Skeleton Skeleton
function function Foo Foo (X: Integer)(X: Integer)return Float return Float
isis……
end end FooFoo;;
34http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
networknetwork
ClientClientClient ServerServerServer
function Foofunction Foo (X :(X : IntegerInteger) return) return Float isFloat is ......
ClientClientClient ServerServerServer
function Foofunction Foonetworknetwork
callcall
returnreturn
callcall
returnreturn
parameterparametermarshallingmarshalling
callcall
returnreturn
resultresultunmarshallingunmarshalling
resultresultmarshallingmarshalling
resultresultunmarshallingunmarshalling
ClientClient StubStub ServerServer SkeletonSkeleton
35http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Enhancing Enhancing RPCsRPCs
•• ExceptionsExceptions–– exceptionsexceptions raisedraised inin the callee canbe transmittedthe callee canbe transmitted toto
thethe callercaller over theover the networknetwork
•• Asynchronous callsAsynchronous calls–– thethe callercaller doesdoes notnot needneed toto waitwait forfor the result from the the result from the
calleecallee (one(one way procedure callsway procedure calls))
•• Pointers onPointers on remote proceduresremote procedures–– RPCRPC throughthrough a pointer.a pointer. At theAt the point of callpoint of call the specthe spec ofof
the callee is knownthe callee is known but notbut not itsits location orlocation or identityidentity
36http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Service Related to Service Related to RPCsRPCs::NamingNaming
•• RecordsRecords thethe location oflocation of the various processesthe various processes–– location of clientlocation of client stubs and server skeletonsstubs and server skeletons
•• This serviceThis service is calledis called via RPCvia RPC
•• ToTo solve the circularity problem the namingsolve the circularity problem the namingserviceservice is atis at aa knownknown machinemachine addressaddress
37http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Answer 3: Distributed ObjectsAnswer 3: Distributed Objects
A: A: Alert’Class Alert’Class := Get_Alert;:= Get_Alert;……Handle (A);Handle (A);
type Alert is tagged record…;type Alert is tagged record…;procedure Handle (A : in out Alert);procedure Handle (A : in out Alert);
Dynamic Dynamic BindingBinding
type Medium_Alert is new Alert...;type Medium_Alert is new Alert...;procedure Handle (A : in out Medium_Alert);procedure Handle (A : in out Medium_Alert);
??
38http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• IntroductionIntroduction•• Distributed Distributed ProgProg. Paradigms. Paradigms•• Distributed Object TechnologiesDistributed Object Technologies
–– Language Dependent: Ada 95Language Dependent: Ada 95–– Language Independent: CORBALanguage Independent: CORBA
39http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
LanguageLanguage DependentDependentDistributed Objects ParadigmDistributed Objects Paradigm
bodybodybodybodybodybodybodybody
spec spec spec spec spec spec spec spec
The The samesame programming language is used to writeprogramming language is used to write•• the spec of the distributed servicesthe spec of the distributed services•• the implementation of the server codethe implementation of the server code•• the implementation of the client codethe implementation of the client code
40http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
LanguageLanguage IndependentIndependentDistributed Objects ParadigmDistributed Objects Paradigm
ClientClientClientClientClientClientClientClientlanguage Alanguage A
ServerServerServerServerServerServerServerServerlanguage Blanguage B
specspeclanguage Blanguage B
Different languagesDifferent languages are used to write:are used to write:•• the spec of the distributed servicesthe spec of the distributed services•• the implementation of the server codethe implementation of the server code•• the implementation of the client codethe implementation of the client code
language language language language language language language language indepindepindepindepindepindepindepindep........spec spec spec spec spec spec spec spec
41http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• IntroductionIntroduction•• Distributed Distributed ProgProg. Paradigms. Paradigms•• Distributed Object TechnologiesDistributed Object Technologies
–– Language Dependent: Ada 95Language Dependent: Ada 95–– Language Independent: CORBALanguage Independent: CORBA
42
Ada 95Ada 95Distributed Systems AnnexDistributed Systems Annex
43http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Ada 95 Distributed Ada 95 Distributed ProgrammingProgramming
Ada 95Ada 95
partitionpartition(process)(process)
multimulti--partitionspartitions
CoreCore Annex EAnnex E
A partition comprises one or more Ada packagesA partition comprises one or more Ada packages
44http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Supported ParadigmsSupported Paradigms
•• Client/Server Paradigm (RPC)Client/Server Paradigm (RPC)
–– Synchronous / AsynchronousSynchronous / Asynchronous
–– Static / DynamicStatic / Dynamic
•• Distributed Objects Distributed Objects
•• Shared MemoryShared Memory
45http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Ada Distributed ApplicationAda Distributed Application•• No need for a separate interfacing language as No need for a separate interfacing language as
in CORBA (IDL)in CORBA (IDL)–– Ada is the IDLAda is the IDL
•• Some packages categorized using Some packages categorized using pragmaspragmas–– Remote_Call_Interface (RCI)Remote_Call_Interface (RCI)–– Remote_TypesRemote_Types–– Shared_Passive (SP)Shared_Passive (SP)
•• All packages except All packages except RCIRCI & & SPSP duplicated on duplicated on partitions using thempartitions using them
46http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Remote_Call_Interface (RCI)Remote_Call_Interface (RCI)
•• Allows subprograms to be called remotelyAllows subprograms to be called remotely
–– Statically bound Statically bound RPCsRPCs
–– Dynamically bound Dynamically bound RPCs RPCs (remote access to subprogram)(remote access to subprogram)
47http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Remote_TypesRemote_Types
•• Allows the definition of a remote access typesAllows the definition of a remote access types
–– Remote access to subprogramRemote access to subprogram
–– Remote reference to objects Remote reference to objects (ability to do dynamically dispatching calls (ability to do dynamically dispatching calls
across the network)across the network)
48http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Shared_PassiveShared_Passive
•• AA SharedShared_Passive package_Passive package containscontains variablesvariablesthat can be accessed fromthat can be accessed from distinct partitionsdistinct partitions
•• Allows support of shared distributed memoryAllows support of shared distributed memory
•• Allows persistence on some implementationsAllows persistence on some implementations
49http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
1.1. Write app as if non distributed.Write app as if non distributed.
2.2. Identify remote procedures, shared variables, and Identify remote procedures, shared variables, and distributed objects &distributed objects & categorizecategorize packages.packages.
3.3. Build & test nonBuild & test non--distributed application.distributed application.
4.4. Write a configuration file forWrite a configuration file for partitionningpartitionning your app.your app.
5.5. Build partitions & test distributed app.Build partitions & test distributed app.package P is
.package P is
.package P is
.
package P is
.
package P is
.package P is
.
package P is
.package P is
.
package P is
.package P is
.
Building a Distributed App in Building a Distributed App in Ada 95Ada 95
50http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Remote_Call_InterfaceRemote_Call_Interface
An ExampleAn Example
51http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package TypesTypes isistype type DeviceDevice is (is (Furnace, BoilerFurnace, Boiler,…);,…);type type PressurePressure is …;is …;type type TemperatureTemperature is …;is …;
end end TypesTypes;;
with Types; use Types;package Sensors is
function Get_P (D: Device) return Pressure;function Get_T (D: Device) return Temperature;
end Sensors;
with with TypesTypes; use ; use TypesTypes;;package package SensorsSensors isis
function function Get_PGet_P ((D: DeviceD: Device) return ) return PressurePressure;;function function Get_TGet_T ((D: DeviceD: Device) return ) return TemperatureTemperature;;
end end SensorsSensors;;
with with TypesTypes; use ; use TypesTypes;;with with SensorsSensors;;procedure procedure Client_1Client_1 isis
P := Sensors.Get_P (Boiler);P := Sensors.Get_P (Boiler);
with with TypesTypes; use ; use TypesTypes;;with with SensorsSensors;;procedure procedure Client_2Client_2 isis
T := Sensors.Get_T (Furnace);T := Sensors.Get_T (Furnace);
Write AppWrite App
52http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package TypesTypes isispragma pragma PurePure;;type type DeviceDevice is (is (Furnace, BoilerFurnace, Boiler,…);,…);type type PressurePressure is …;is …;type type TemperatureTemperature is …;is …;
end end TypesTypes;;
with Types; use Types;package Sensors is
pragma Remote_Call_Interface;function Get_P (D:Device) return Pressure;function Get_T (D:Device) return Temperature;
end Sensors;
with with TypesTypes; use ; use TypesTypes;;package package SensorsSensors isis
pragma pragma Remote_Call_InterfaceRemote_Call_Interface;;function function Get_P (D:Device)Get_P (D:Device) return return PressurePressure;;function function Get_T (D:Device)Get_T (D:Device) return return TemperatureTemperature;;
end end SensorsSensors;;
with with TypesTypes; use ; use TypesTypes;;with with SensorsSensors;;procedure procedure Client_1Client_1 isis
P := Sensors.Get_P (Boiler);P := Sensors.Get_P (Boiler);
with with TypesTypes; use ; use TypesTypes;;with with SensorsSensors;;procedure procedure Client_2Client_2 isis
T := Sensors.Get_T (Furnace);T := Sensors.Get_T (Furnace);
CategorizeCategorize
53http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Build & TestBuild & Test
package package TypesTypes isispragma pragma PurePure;;type type DeviceDevice is (is (Furnace, BoilerFurnace, Boiler,…);,…);type type PressurePressure is …;is …;type type TemperatureTemperature is …;is …;
end end TypesTypes;;
with Types; use Types;package Sensors is
pragma Remote_Call_Interface;function Get_P (D:Device) return Pressure;function Get_T (D:Device) return Temperature;
end Sensors;
with with TypesTypes; use ; use TypesTypes;;package package SensorsSensors isis
pragma pragma Remote_Call_InterfaceRemote_Call_Interface;;function function Get_P (D:Device)Get_P (D:Device) return return PressurePressure;;function function Get_T (D:Device)Get_T (D:Device) return return TemperatureTemperature;;
end end SensorsSensors;;
with with TypesTypes; use ; use TypesTypes;;with with SensorsSensors;;procedure procedure Client_1Client_1 isis
P := Sensors.Get_P (Boiler);P := Sensors.Get_P (Boiler);
54http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Build & TestBuild & Test
package package TypesTypes isispragma pragma PurePure;;type type DeviceDevice is (is (Furnace, BoilerFurnace, Boiler,…);,…);type type PressurePressure is …;is …;type type TemperatureTemperature is …;is …;
end end TypesTypes;;
with Types; use Types;package Sensors is
pragma Remote_Call_Interface;function Get_P (D:Device) return Pressure;function Get_T (D:Device) return Temperature;
end Sensors;
with with TypesTypes; use ; use TypesTypes;;package package SensorsSensors isis
pragma pragma Remote_Call_InterfaceRemote_Call_Interface;;function function Get_P (D:Device)Get_P (D:Device) return return PressurePressure;;function function Get_T (D:Device)Get_T (D:Device) return return TemperatureTemperature;;
end end SensorsSensors;;
with with TypesTypes; use ; use TypesTypes;;with with SensorsSensors;;procedure procedure Client_2Client_2 isis
T := Sensors.Get_T (Furnace);T := Sensors.Get_T (Furnace);
55http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
configuration configuration ConfigConfig_1_1 isisNode_ANode_A : Partition := (: Partition := (SensorsSensors););Node_BNode_B : Partition := (: Partition := (Client_1Client_1););Node_CNode_C : Partition := (: Partition := (Client_2Client_2););
end end ConfigConfig_1_1;;
PartitionPartition
56http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
PartitionPartition
Node_ANode_A
Node_BNode_B Node_CNode_C
57http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package TypesTypes isispragma pragma PurePure;;type type DeviceDevice is …;is …;type type PressurePressure is …;is …;type type TemperatureTemperature is …;is …;
end end TypesTypes;;DUPLICATEDDUPLICATED Node_ANode_A
Node_BNode_B Node_CNode_C
58http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with Types; use Types;package Sensors is
pragma Remote_Call_Interface;function Get_P(…) return Pressure;function Get_T(…) return Temperature;
end Sensors;
with with TypesTypes; use ; use TypesTypes;;package package SensorsSensors isis
pragma pragma Remote_Call_InterfaceRemote_Call_Interface;;function function Get_P(…)Get_P(…) return return PressurePressure;;function function Get_T(…)Get_T(…) return return TemperatureTemperature;;
end end SensorsSensors;;
STUBSSTUBSNode_ANode_A
Node_BNode_B Node_CNode_C
59http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with Types; use Types;package Sensors is
pragma Remote_Call_Interface;function Get_P(…) return Pressure;function Get_T(…) return Temperature;
end Sensors;
with with TypesTypes; use ; use TypesTypes;;package package SensorsSensors isis
pragma pragma Remote_Call_InterfaceRemote_Call_Interface;;function function Get_P(…)Get_P(…) return return PressurePressure;;function function Get_T(…)Get_T(…) return return TemperatureTemperature;;
end end SensorsSensors;;
SKELETONSKELETON+ BODY+ BODY
Node_ANode_A
Node_BNode_B Node_CNode_C
60http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
….:= Sensors.Get_P (Boiler);….:= Sensors.Get_P (Boiler);
Sensors.Get_P StubSensors.Get_PSensors.Get_P StubStub
Marshal ArgumentsMarshal ArgumentsMarshal Arguments
SendSend ReceiveReceive
Sensors.Get_PSensors.Get_P bodybody
Unmarshal ArgumentsUnmarshalUnmarshal ArgumentsArguments
SkeletonSkeletonSelect bodySelect bodySelect body
Node_BNode_B Node_ANode_A
61http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with Types; use Types;package Sensors is
pragma Remote_Call_InterfaceRemote_Call_Interface;… procedure Log (D : Device; P : Pressure);pragma AsynchronousAsynchronous (Log);
end Bank;
Asynchronous CallsAsynchronous Calls
+ returns immediately+ exceptions are lost+ parameters must be in
62http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Remote_TypesRemote_Types
An ExampleAn Example
63http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package AlertsAlerts isistype type AlertAlert is abstract tagged private;is abstract tagged private;typetype AlertAlert__Ref Ref is accessis access allall Alert’ClassAlert’Class;;procedure procedure Handle (A : Handle (A : accessaccess Alert);Alert);procedure procedure Log (A : Log (A : accessaccess Alert) Alert) is abstractis abstract;;
privateprivate......
end end Alerts;Alerts;package package Alerts.Pool Alerts.Pool isis
procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium; with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
Write AppWrite App
64http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package Alerts.LowAlerts.Low isistype type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
with with Alerts.Pool; Alerts.Pool; use use Alerts.Pool;Alerts.Pool;package body package body Alerts.Low Alerts.Low isis
......beginbegin
Register (Register (newnew Low_Alert);Low_Alert);end end AlertsAlerts..Low;Low;
65http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package Alerts.Medium Alerts.Medium isistype type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
with with Alerts.Pool; Alerts.Pool; use use Alerts.Pool;Alerts.Pool;package body package body Alerts.Medium Alerts.Medium isis
......beginbegin
Register (Register (newnew Medium_Alert);Medium_Alert);end end AlertsAlerts..Medium;Medium;
66http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package AlertsAlerts isispragmapragma Remote_TypesRemote_Types;type type AlertAlert is abstract tagged private;is abstract tagged private;typetype AlertAlert__Ref Ref is accessis access allall Alert’ClassAlert’Class;;procedure procedure Handle (A : Handle (A : accessaccess Alert);Alert);procedure procedure Log (A : Log (A : accessaccess Alert) Alert) is abstractis abstract;;
privateprivate......
end end Alerts;Alerts;package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium; with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
CategorizeCategorize
67http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
package package Alerts.Medium Alerts.Medium isispragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
68http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
package package AlertsAlerts isispragmapragma Remote_TypesRemote_Types;type type AlertAlert is abstract tagged private;is abstract tagged private;typetype AlertAlert__Ref Ref is accessis access allall Alert’ClassAlert’Class;;procedure procedure Handle (A : Handle (A : accessaccess Alert);Alert);procedure procedure Log (A : Log (A : accessaccess Alert) Alert) is abstractis abstract;;
privateprivate......
end end Alerts;Alerts;
package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium;
with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
Build & Build & TestTest
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;package package Alerts.Medium Alerts.Medium isis
pragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
69http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
configuration configuration ConfigConfig_2_2 isisNode_ALNode_AL : Partition := (: Partition := (Alerts.LowAlerts.Low););Node_AMNode_AM : Partition := (: Partition := (Alerts.MediumAlerts.Medium););Node_BNode_B : Partition := (: Partition := (Alerts.PoolAlerts.Pool););Node_CNode_C : Partition := (: Partition := (Process_AlertsProcess_Alerts););
end end ConfigConfig_2_2;;
PartitionPartition
70http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
What HappensWhat HappensWhen ExecutingWhen Executing
the Distributed Program ?the Distributed Program ?
71http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium;
package package Alerts.Medium Alerts.Medium isispragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
Node_ALNode_AL Node_AMNode_AM
Node_BNode_B Node_CNode_C
Step 1: A Low_Alert object in Node_AL registers itself with NodeStep 1: A Low_Alert object in Node_AL registers itself with Node_B_B
72http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium;
package package Alerts.Medium Alerts.Medium isispragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
Node_ALNode_AL Node_AMNode_AM
Node_BNode_B Node_CNode_C
Step 2: A Medium_Alert object in Node_AM registers itself with NStep 2: A Medium_Alert object in Node_AM registers itself with Node_Bode_B
73http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium;
package package Alerts.Medium Alerts.Medium isispragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
Node_ALNode_AL Node_AMNode_AM
Node_BNode_B Node_CNode_C
Step 3: Process_Alerts in Node_C does an RPC to Get_Alert in NodStep 3: Process_Alerts in Node_C does an RPC to Get_Alert in Node_Be_B
74http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium;
package package Alerts.Medium Alerts.Medium isispragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
Node_ALNode_AL Node_AMNode_AM
Node_BNode_B Node_CNode_C
Step 4: Get_Alert returns a pointer to an Alert object (Low_AlerStep 4: Get_Alert returns a pointer to an Alert object (Low_Alert or Medium_Alert)t or Medium_Alert)
75http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
with with Alerts, Alerts.Pool;Alerts, Alerts.Pool; use use Alerts;Alerts;procedure procedure Process_Alerts Process_Alerts isisbeginbegin
looploopHandle (Pool.Get_Alert);Handle (Pool.Get_Alert);
end loop;end loop;end end Process_Alerts;Process_Alerts;
package package Alerts.LowAlerts.Low isispragmapragma Remote_TypesRemote_Types;type type Low_AlertLow_Alert is new is new Alert Alert with private;with private;procedure procedure Log (A : Log (A : accessaccess Low_Alert);Low_Alert);
privateprivate......
end end Alerts.Low;Alerts.Low;
package package Alerts.Pool Alerts.Pool isispragma pragma Remote_Call_InterfaceRemote_Call_Interface;;procedure procedure Register (A : Alert_Ref);Register (A : Alert_Ref);function function Get_Alert Get_Alert return return Alert_Ref;Alert_Ref;
end end Medium;Medium;
package package Alerts.Medium Alerts.Medium isispragmapragma Remote_TypesRemote_Types;type type Medium_AlertMedium_Alert is new is new Alert Alert with private;with private;procedure procedure Handle (A : Handle (A : accessaccess Medium_Alert);Medium_Alert);procedure procedure Log (A : Log (A : accessaccess Medium_Alert);Medium_Alert);
privateprivate......
end end AlertsAlerts..Medium;Medium;
Node_ALNode_AL Node_AMNode_AM
Node_BNode_B Node_CNode_C
Step 5: Node_C performs a dispatching RPC. It calls Handle in NoStep 5: Node_C performs a dispatching RPC. It calls Handle in Node_AL or Node_AMde_AL or Node_AM
????
76http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
What Does GetWhat Does Get__AlertAlert Return ?Return ?
PointerPointerPointerPointerPointerPointerPointerPointer
MachineMachineAddressAddress ofofAlert objectAlert object
onon thetheMachineMachine
Get_AlertGet_Alert
77http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Remote Access to Class Wide TypeRemote Access to Class Wide Type
•• At compile time:At compile time:
–– You do not know what operation you’ll You do not know what operation you’ll dispatch todispatch to
–– On what node that operations will be On what node that operations will be executed onexecuted on
78http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• IntroductionIntroduction•• Distributed Distributed ProgProg. Paradigms. Paradigms•• Distributed Object TechnologiesDistributed Object Technologies
–– Language Dependent: Ada 95Language Dependent: Ada 95–– Language Independent: CORBALanguage Independent: CORBA
79http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
LanguageLanguage IndependentIndependentDistributed Objects ParadigmDistributed Objects Paradigm
ClientClientClientClientClientClientClientClientlanguage Alanguage A
ServerServerServerServerServerServerServerServerlanguage Blanguage B
specspeclanguage Blanguage B
Different languagesDifferent languages are used to write:are used to write:•• the spec of the distributed servicesthe spec of the distributed services•• the implementation of the server codethe implementation of the server code•• the implementation of the client codethe implementation of the client code
language language language language language language language language indepindepindepindepindepindepindepindep........Spec (IDL) Spec (IDL) Spec (IDL) Spec (IDL) Spec (IDL) Spec (IDL) Spec (IDL) Spec (IDL)
80http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
CORBA InterfacesCORBA Interfaces
•• InIn CorbaCorba interfaces areinterfaces are describeddescribed in IDL in IDL –– (Interface Description(Interface Description LanguageLanguage))
•• TheThe IDLIDL is independentis independent ofof programming languagesprogramming languages•• EachEach interfaceinterface is translatedis translated inin
–– LanguageLanguage AA usedused forfor thethe client (clientclient (client stubstub))–– LanguageLanguage BB usedused forfor the serverthe server ((server skeletonserver skeleton))
•• ToTo implement the server theimplement the server the programmerprogrammer completes completes the skeletonthe skeleton inin languagelanguage BB
•• ToTo implement theimplement the clientclient thethe programmer usesprogrammer uses thetheservicesservices providedprovided by thby th estubestub inin languagelanguage AA
81http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
TheThe CORBA ArchitectureCORBA Architecture
•• RPC goRPC go through thethrough the ORB ORB –– ((Object RequestObject Request Broker)Broker)
•• TheThe ORBORB isis a software busa software bus
•• ORBs communicate withORBs communicate with a set ofa set of standardised standardised protocolsprotocols–– IIOP, GIOPIIOP, GIOP
82http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
TheThe IDLIDL
•• Syntax similarSyntax similar to C++to C++ with somewith some Ada additionsAda additions
•• IDL mustIDL must bebe translatable intranslatable in various progvarious prog.. LanguagesLanguages–– Ada, C, C++, Java, …Ada, C, C++, Java, …
•• ThereThere are limitations inare limitations in what you can writewhat you can write inin thethe IDLIDL
•• Programmer mustProgrammer must understandunderstand howhow thethe IDLIDL is is translatedtranslated inin thethe hosthost languagelanguage–– toto complete the server skeletoncomplete the server skeleton
–– to useto use thethe clientclient stubstub
83http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ExampleExample
package M package M isispragmapragma RemoteRemote_Types;_Types;type T type T is tagged is tagged …;…;procedure procedure P (O : inP (O : in accessaccess T);T);
endend M;M;
module M {module M {interface T {interface T {
void void P ();P ();};};
};};
84http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ExempleExemplemodule Echo {
string echoStringechoString (in string mesg);
};
Module foo {
interface Buffer {
exception Empty;
void put (in string content);
string get() raises (Empty);
}
};
85http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ExampleExample of IDL translation in Adaof IDL translation in Ada
with Corba.Object;package Echo is
type Ref is new Corba.Object.Ref with null record;function To_Echo (Self : in Corba.Object.Ref’Class)
return Ref’Class;function To_Ref (From : in Corba.Any) return Ref;function To_Any (From : in Ref) return Corba.Any;function echoStringechoString (Self : in Ref;
msg : in Corba.String)return Corba.String;
Null_Ref : constant Ref := (Corba.Object.Null_Refwith null record);
Echo_R_Id : constant Corba.RepositoryId :=Corba.To_Unbounded_String («IDL:Echo:1.0»);
end Echo;
86http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
CORBA ServicesCORBA Services
•• TheThe CORBACORBA corecore services areservices are veryvery fewfew
•• LotLot ’s of’s of externalexternal servicesservices–– NamingNaming ((distributed and hierarchicaldistributed and hierarchical))–– PersistancePersistance–– TransactionTransaction–– SecuritySecurity–– ......
87http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
ApplicationApplicationObjectsObjects
Object ServicesObject Services
CommonCommonFacilitiesFacilities
O R BO R B
Code you write
Code you Code you writewrite
Domain Independent
Domain Domain IndependentIndependent
DomainSpecificDomainDomainSpecificSpecific
88http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
•• IntroductionIntroduction•• Distributed Distributed ProgProg. Paradigms. Paradigms•• Distributed Object TechnologiesDistributed Object Technologies•• ConclusionConclusion
89http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Developing a Distributed AppDeveloping a Distributed App
•• Using network services directlyUsing network services directly–– SocketsSockets
•• Using middlewareUsing middleware–– CORBACORBA–– COM/DCOMCOM/DCOM
•• Using a distributed languageUsing a distributed language–– Ada 95 DSAAda 95 DSA–– Java RMIJava RMI
Similar issueswith
Tasking
90http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Impact on Development PhasesImpact on Development Phases
GeneralGeneralDesignDesign
DistributedDistributedDesignDesign
CodingCoding
TestingTesting
91http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
SocketsSockets
GeneralGeneralDesignDesign
DistributedDistributedDesignDesign
CodingCoding
TestingTesting
Ad HocAd Hoc
Very low levelVery low level
Distributed Distributed mode onlymode only
92http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
CodingCoding
Very low levelVery low level
•• Everything must be done with socketsEverything must be done with sockets•• Data marshaling/Data marshaling/unmarshallingunmarshalling•• Handle heterogeneous systems directlyHandle heterogeneous systems directly
93http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
CORBACORBA
GeneralGeneralDesignDesign
DistributedDistributedDesignDesign
CodingCoding
TestingTesting
IDLIDL
Must invoke highMust invoke high--level level services directlyservices directly
Distributed Distributed mode onlymode only
94http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Ada 95 DSAAda 95 DSA
GeneralGeneralDesignDesign
DistributedDistributedDesignDesign
CodingCoding
TestingTesting
Ada 95Ada 95
distributeddistributed& non& non--distributeddistributed
Regular AdaRegular AdaCodingCoding
95http://libre.act-europe.fr © ACT Europe under the GNU Free Documentation License
Ada 95 DSA & CORBA:Ada 95 DSA & CORBA:BenefitsBenefits
•• Save developer’s time, in socket programming:Save developer’s time, in socket programming:–– Defining a client/server protocolDefining a client/server protocol–– Defining a message formatDefining a message format–– Marshalling of dataMarshalling of data–– UnmarshallingUnmarshalling datadata
•• Raise the level of abstractionRaise the level of abstraction