SlideShare a Scribd company logo
1 of 37
Download to read offline
CORBA Introduction
- Common Object Request Broker Architecture
1
--by WangJianmin
http://weibo.com/lanxuezaipiao/
http://www.cnblogs.com/lanxuezaipiao
2
Outline
 Distributed Computing
 CORBA Introduction
 Architecture
 Key components
 An example
 Advantages
3
Distributed Computing
 Local vs. Remote objects
 An enterprise app is a collection of co-
operating objects located on different machines
4
Existing Mechanisms
 Sockets (TCP, UDP) not OO
 RPC (not OO)
 CORBA
 RMI
 EJB
 JMS
 DCOM
 WebService
 ……
CORBA vs. WebService
5
 One important observation concerning CORBA and Web services
is that whatever can be accomplished by CORBA can be
accomplished using Web service technologies and vice versa,
although the amount of effort required would be noticeably
different. In particular, one can implement CORBA on top of
SOAP, or SOAP on top of CORBA.
6
Aspect CORBA Web services
Data model Object model SOAP message exchange
model
Client-Server coupling Tight Loose
Location transparency Object references URL
Type system IDL XML schemas
static + runtime checks runtime checks only
Error handling IDL exception SOAP fault messages
Serialization built into the ORB can be chosen by the user
Parameter passing by reference by value (no notion of
objects)
by value (valuetype)
Transfer syntax CDR used on the wire XML used on the wire
binary format Unicode
State stateful stateless
Request semantics at-most-once defined by SOAP
Runtime composition DII UDDI/WSDL
Registry Interface Repository UDDI/WSDL
Implementation repository
Service discovery CORBA naming/trading
service
UDDI
RMI registry
Language support any language with an IDL
binding
any language
Security CORBA security service HTTP/SSL, XML signature
Firewall Traversal work in progress uses HTTP port 80
Events CORBA event service N/A
CORBA vs. RMI
 CORBA interfaces are defined in IDL, RMI interfaces are defined
in Java
 CORBA is language-independent, RMI is not
 CORBA objects are not garbage collected, RMI objects are
garbage collected automatically.
 RMI does not support “out” and “inout” operations since local
objects are copied, and remote objects passed by reference to
stub
 RMI-IIOP(RMI and CORBA): less resources and more robust
7
8
CORBA vs. EJB
 These have many common objectives
– definition, packaging and deployment of components
 CORBA has always been component oriented
– EJB ideas are being extended and incorporated into CORBA 3
– EJB is like CORBA without language independence
 A Java-based CORBA will then be the best EJB
– a EJB flavor on the richness of CORBA
 EJB mandates CORBA interoperability
– and many EJB services are very close derivatives of their
CORBA forerunners.
 Why is this so important?
– Because more component frameworks will emerge over time!
9
CORBA Introduction
 A standard controlled by the Object
Management Group (OMG)
 A spec for creating distributed objects
 Its architecture is based on the object model
 Promotes design of applications as a set of
cooperating objects
 based on client/server concepts
CORBA Objects
 It is important to note that CORBA objects differ
from typical programming objects in three
ways:
– CORBA objects can run on any platform.
– CORBA objects can be located anywhere on the
network.
– CORBA objects can be written in any language that
has IDL mapping.
10
CORBA Architecture
11
ORB core
Dynamic
Invocation
IDL
Stubs
ORB
Interface
Object
Adapter
Static IDL
Skeleton
Dynamic
Skeleton
Client Object Implementation
Standard Interface Per-Object Type
Generated Interface
ORB Dependent
Interface
Interface
Repository
Implementation
Repository
12
Middleware?
First key - ORB
13
Client
Client
Client
Server
Server
Server
ORB
First key - ORB
 Provides a communications hub for all objects
– analogous to a hardware bus
 Uses a broker to handle messages requests
between clients and servers
– broker can choose server that best fits needs of
client
– allows separation of interface and implementation
– allows building block approach to development and
evolution
14
15
First key - ORB
 Object bus that provides object location
transparency
 Responsible for mechanisms to:
– Find the object implementation of the request
– Prepare object implementation to receive the
request
– Communicate the data making up the request
Object adapter
 An object adapter is the primary means for an object
implementation to access ORB services such as object
reference generation.
 an object adapter bridges the gap between
– CORBA objects with IDL interfaces and
– the programming language interfaces of the corresponding servant
(classes)
16
Object adapter
 An object adapter has the following tasks:
– it creates remote object references for CORBA objects;
– it dispatches each RMI via a skeleton to the appropriate servant;
– it activates objects.
 An object adapter gives each CORBA object a unique object
name.
– the same name is used each time an object is activated.
 it is specified by the application program or generated by the object
adapter.
– Each active CORBA object is registered with its object adapter,
 which keeps a remote object table to maps names of CORBA objects to
servants.
 Each object adapter has its own name - specified by the
application program or generated automatically.
 OA helps the ORB to operate with different type of objects.
17
18
How to Communicate?
19
Second key - IDL
Java
C++
C
VB
Ada
Implementation is
Hidden behind
interface
Service or Contract-
oriented View
Why IDL?
 IDL provides facilities for defining modules, interfaces,
types, attributes and method signatures.
 IDL has the same lexical rules as C++ but has
additional keywords to support distribution,
– e.g. interface, any, attribute, in, out, inout, readonly, raises.
 It allows standard C++ pre-processing facilities.
– e.g. typedef for All.
 The grammar of IDL is a subset of ANSI C++ with
additional constructs to support method signatures.
20
IDL Structure
module <identifier> {
<type declarations>;
<constant declarations>;
<exception declarations;
<interface definition>;
<interface definition>;
};
21
22
Agreement?
23
CORBA Software Bus
C++ COBOL Smalltalk
Interface
Definition
Language
Protocol for
communication:
IIOP
Java VB
24
Third key - IIOP
 The General Inter-ORB protocol(GIOP) defines
– an external data representation, called CDR
– specifies formats for the messages in a request-
reply protocol.
• including messages for enquiring about the location of an
object, for cancelling requests and for reporting errors.
 The Internet Inter-ORB protocol (IIOP) defines
a standard form for remote object references.
– IIOP is a specialized form of GIOP for TCP/IP
networks.
25
Third key - IIOP
 Don't be put off by GIOP and IIOP, they are just
names for familiar things
– GIOP is just about external data representation and
a Request-reply protocol allowing for objects to be
activated
– IIOP is just about remote object references
26
Corba Services
 Naming Service
 Event Service and Notification Service:
– in ES suppliers and consumers communicate via an event channel
– NS extends this to allow filtering and typed events
 Security service:
– authentication of principals and access control of CORBA objects with
policies
– auditing by servers, facilities for non-repudiation
 Trading service:
– allows CORBA objects to be located by attribute
 Transaction service and concurrency control service
– TS provides flat or nested transactions
– CCS provides locking of CORBA objects
 Persistent object service:
– for storing the state of CORBA objects in a passive form and
retrieving it
Steps of a CORBA-based App
 The steps involved:
– Define an interface(IDL file)
– Map IDL to Java (idlj compiler)
– Implement the interface
– Write a Server
– Write a Client
– Run the application
 Example: a step-by-step Hello example
27
Step 1: define the interface
28
 Hello.idl
module HelloApp {
interface Hello {
string sayHello();
};
};
Step 2: map Hello.idl to Java
29
 Use the idlj compiler
idlj -fall Hello.idl (Inheritance model)
idlj -fallTie -oldImplBase Hello.idl (Tie model)
 This will generate:
_HelloImplBase.java (server skeleton)
HelloStub.java (client stub, or proxy)
Hello_Tie.java (only Tie model)
Hello.java
HelloHelper.java
HelloHolder.java
HelloOperations.java
Step 3: implement the interface
30
 Implement the servant
public class HelloImpl extends _HelloImplBase {
public String sayHello() {
return "nHello world !!n";
}
}
Step 4: implement the server
31
 Creates and initializes an ORB instance
– ORB orb = ORB.init(args, null);
 Creates a servant instance (the implementation of one CORBA
Hello object)
– HelloImpl helloImpl = new HelloImpl();
 Obtain a reference for the desired object and register it with ORB
– By creating a tie with the servant being the delegate(Tie model)
– By a naming context (Inheritance model)
 "Stringify" the reference
– String ior = orb.object_to_string(hello);
 Waits for invocations of the new object from the client
– orb.run();
– Thread.currentThread().join();
Step 4: implement the server
 Note: to use a CORBA object, you must posses a valid reference
to it. An object reference may be obtained in one of three ways:
– CORBA::ORB::resolve_initial_references( <class-name> )
returns a reference to the specified class if the ORB can find it
– Invoking a "factory" method on an object whose reference you
already have (a "factory" creates other objects)
– Converting a "stringified" reference to a real reference
 the preferred way to obtain an object reference is the latter
32
Step 5: write a client
33
 Creates and initializes an ORB instance
– ORB orb = ORB.init(args, null);
 Obtain a reference for the desired object from IOR.
– read stringified object from IOR
– resolve the Object Reference(by HelloHelper.narrow() method)
 "Invokes the object's sayHello() operations and prints the result
Step 6: run the application
 Compile the .java files, including the stubs and skeletons
– javac *.java HelloApp/*.java
 Start orbd
– orbd -ORBInitialPort 1050 -ORBInitialHost localhost&
 Start the Hello server
– java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost&
 Run the client application
– java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost
34
35
Advantages of CORBA
 Object Location Transparency
 Server Transparency
 Language Transparency
 Implementation Transparency
 Architecture Transparency
 Operating System Transparency
 Protocol Transparency
References
 Java IDL: The "Hello World" Example With The ImplBase Server-Side
Model (old version)
 Java IDL: The "Hello World" Example
 Java IDL: The "Hello World" Example With The ImplBase Server-Side
Model
 CORBA Tutorial
 Locating CORBA objects using Java IDL
36
37
THANK YOU

More Related Content

Similar to corbaintroductionandexample-140703005744-phpapp02.pdf

corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxAasimAbdul
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connectionMohammedAkramMohiudd
 
CORBA - Introduction and Details
CORBA - Introduction and DetailsCORBA - Introduction and Details
CORBA - Introduction and Detailsdgsdg2websd
 
Distributing computing.pptx
Distributing computing.pptxDistributing computing.pptx
Distributing computing.pptxKaviya452563
 
Distributed computing - november 2006
Distributed computing  - november 2006Distributed computing  - november 2006
Distributed computing - november 2006achraf_ing
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecturenupurmakhija1211
 
EAI and Attachmate Pt. 2 9-00
EAI and Attachmate Pt. 2  9-00EAI and Attachmate Pt. 2  9-00
EAI and Attachmate Pt. 2 9-00Jeff Krukin
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Sri Prasanna
 
Corba in power system
Corba in power systemCorba in power system
Corba in power systemPROTIM PAUL
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studieshushu
 

Similar to corbaintroductionandexample-140703005744-phpapp02.pdf (20)

Corba
CorbaCorba
Corba
 
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptx
 
CORBA
CORBACORBA
CORBA
 
CORBA.ppt
CORBA.pptCORBA.ppt
CORBA.ppt
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connection
 
CORBA - Introduction and Details
CORBA - Introduction and DetailsCORBA - Introduction and Details
CORBA - Introduction and Details
 
Distributing computing.pptx
Distributing computing.pptxDistributing computing.pptx
Distributing computing.pptx
 
Corba model ppt
Corba model pptCorba model ppt
Corba model ppt
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
Distributed computing - november 2006
Distributed computing  - november 2006Distributed computing  - november 2006
Distributed computing - november 2006
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecture
 
EAI and Attachmate Pt. 2 9-00
EAI and Attachmate Pt. 2  9-00EAI and Attachmate Pt. 2  9-00
EAI and Attachmate Pt. 2 9-00
 
Corba
CorbaCorba
Corba
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 
Chapter2
Chapter2Chapter2
Chapter2
 
Common Object Request Broker Architecture
Common Object Request Broker ArchitectureCommon Object Request Broker Architecture
Common Object Request Broker Architecture
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
 
Chapter 17 corba
Chapter 17 corbaChapter 17 corba
Chapter 17 corba
 
Corba in power system
Corba in power systemCorba in power system
Corba in power system
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
 

Recently uploaded

Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 

Recently uploaded (20)

Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 

corbaintroductionandexample-140703005744-phpapp02.pdf

  • 1. CORBA Introduction - Common Object Request Broker Architecture 1 --by WangJianmin http://weibo.com/lanxuezaipiao/ http://www.cnblogs.com/lanxuezaipiao
  • 2. 2 Outline  Distributed Computing  CORBA Introduction  Architecture  Key components  An example  Advantages
  • 3. 3 Distributed Computing  Local vs. Remote objects  An enterprise app is a collection of co- operating objects located on different machines
  • 4. 4 Existing Mechanisms  Sockets (TCP, UDP) not OO  RPC (not OO)  CORBA  RMI  EJB  JMS  DCOM  WebService  ……
  • 5. CORBA vs. WebService 5  One important observation concerning CORBA and Web services is that whatever can be accomplished by CORBA can be accomplished using Web service technologies and vice versa, although the amount of effort required would be noticeably different. In particular, one can implement CORBA on top of SOAP, or SOAP on top of CORBA.
  • 6. 6 Aspect CORBA Web services Data model Object model SOAP message exchange model Client-Server coupling Tight Loose Location transparency Object references URL Type system IDL XML schemas static + runtime checks runtime checks only Error handling IDL exception SOAP fault messages Serialization built into the ORB can be chosen by the user Parameter passing by reference by value (no notion of objects) by value (valuetype) Transfer syntax CDR used on the wire XML used on the wire binary format Unicode State stateful stateless Request semantics at-most-once defined by SOAP Runtime composition DII UDDI/WSDL Registry Interface Repository UDDI/WSDL Implementation repository Service discovery CORBA naming/trading service UDDI RMI registry Language support any language with an IDL binding any language Security CORBA security service HTTP/SSL, XML signature Firewall Traversal work in progress uses HTTP port 80 Events CORBA event service N/A
  • 7. CORBA vs. RMI  CORBA interfaces are defined in IDL, RMI interfaces are defined in Java  CORBA is language-independent, RMI is not  CORBA objects are not garbage collected, RMI objects are garbage collected automatically.  RMI does not support “out” and “inout” operations since local objects are copied, and remote objects passed by reference to stub  RMI-IIOP(RMI and CORBA): less resources and more robust 7
  • 8. 8 CORBA vs. EJB  These have many common objectives – definition, packaging and deployment of components  CORBA has always been component oriented – EJB ideas are being extended and incorporated into CORBA 3 – EJB is like CORBA without language independence  A Java-based CORBA will then be the best EJB – a EJB flavor on the richness of CORBA  EJB mandates CORBA interoperability – and many EJB services are very close derivatives of their CORBA forerunners.  Why is this so important? – Because more component frameworks will emerge over time!
  • 9. 9 CORBA Introduction  A standard controlled by the Object Management Group (OMG)  A spec for creating distributed objects  Its architecture is based on the object model  Promotes design of applications as a set of cooperating objects  based on client/server concepts
  • 10. CORBA Objects  It is important to note that CORBA objects differ from typical programming objects in three ways: – CORBA objects can run on any platform. – CORBA objects can be located anywhere on the network. – CORBA objects can be written in any language that has IDL mapping. 10
  • 11. CORBA Architecture 11 ORB core Dynamic Invocation IDL Stubs ORB Interface Object Adapter Static IDL Skeleton Dynamic Skeleton Client Object Implementation Standard Interface Per-Object Type Generated Interface ORB Dependent Interface Interface Repository Implementation Repository
  • 13. First key - ORB 13 Client Client Client Server Server Server ORB
  • 14. First key - ORB  Provides a communications hub for all objects – analogous to a hardware bus  Uses a broker to handle messages requests between clients and servers – broker can choose server that best fits needs of client – allows separation of interface and implementation – allows building block approach to development and evolution 14
  • 15. 15 First key - ORB  Object bus that provides object location transparency  Responsible for mechanisms to: – Find the object implementation of the request – Prepare object implementation to receive the request – Communicate the data making up the request
  • 16. Object adapter  An object adapter is the primary means for an object implementation to access ORB services such as object reference generation.  an object adapter bridges the gap between – CORBA objects with IDL interfaces and – the programming language interfaces of the corresponding servant (classes) 16
  • 17. Object adapter  An object adapter has the following tasks: – it creates remote object references for CORBA objects; – it dispatches each RMI via a skeleton to the appropriate servant; – it activates objects.  An object adapter gives each CORBA object a unique object name. – the same name is used each time an object is activated.  it is specified by the application program or generated by the object adapter. – Each active CORBA object is registered with its object adapter,  which keeps a remote object table to maps names of CORBA objects to servants.  Each object adapter has its own name - specified by the application program or generated automatically.  OA helps the ORB to operate with different type of objects. 17
  • 19. 19 Second key - IDL Java C++ C VB Ada Implementation is Hidden behind interface Service or Contract- oriented View
  • 20. Why IDL?  IDL provides facilities for defining modules, interfaces, types, attributes and method signatures.  IDL has the same lexical rules as C++ but has additional keywords to support distribution, – e.g. interface, any, attribute, in, out, inout, readonly, raises.  It allows standard C++ pre-processing facilities. – e.g. typedef for All.  The grammar of IDL is a subset of ANSI C++ with additional constructs to support method signatures. 20
  • 21. IDL Structure module <identifier> { <type declarations>; <constant declarations>; <exception declarations; <interface definition>; <interface definition>; }; 21
  • 23. 23 CORBA Software Bus C++ COBOL Smalltalk Interface Definition Language Protocol for communication: IIOP Java VB
  • 24. 24 Third key - IIOP  The General Inter-ORB protocol(GIOP) defines – an external data representation, called CDR – specifies formats for the messages in a request- reply protocol. • including messages for enquiring about the location of an object, for cancelling requests and for reporting errors.  The Internet Inter-ORB protocol (IIOP) defines a standard form for remote object references. – IIOP is a specialized form of GIOP for TCP/IP networks.
  • 25. 25 Third key - IIOP  Don't be put off by GIOP and IIOP, they are just names for familiar things – GIOP is just about external data representation and a Request-reply protocol allowing for objects to be activated – IIOP is just about remote object references
  • 26. 26 Corba Services  Naming Service  Event Service and Notification Service: – in ES suppliers and consumers communicate via an event channel – NS extends this to allow filtering and typed events  Security service: – authentication of principals and access control of CORBA objects with policies – auditing by servers, facilities for non-repudiation  Trading service: – allows CORBA objects to be located by attribute  Transaction service and concurrency control service – TS provides flat or nested transactions – CCS provides locking of CORBA objects  Persistent object service: – for storing the state of CORBA objects in a passive form and retrieving it
  • 27. Steps of a CORBA-based App  The steps involved: – Define an interface(IDL file) – Map IDL to Java (idlj compiler) – Implement the interface – Write a Server – Write a Client – Run the application  Example: a step-by-step Hello example 27
  • 28. Step 1: define the interface 28  Hello.idl module HelloApp { interface Hello { string sayHello(); }; };
  • 29. Step 2: map Hello.idl to Java 29  Use the idlj compiler idlj -fall Hello.idl (Inheritance model) idlj -fallTie -oldImplBase Hello.idl (Tie model)  This will generate: _HelloImplBase.java (server skeleton) HelloStub.java (client stub, or proxy) Hello_Tie.java (only Tie model) Hello.java HelloHelper.java HelloHolder.java HelloOperations.java
  • 30. Step 3: implement the interface 30  Implement the servant public class HelloImpl extends _HelloImplBase { public String sayHello() { return "nHello world !!n"; } }
  • 31. Step 4: implement the server 31  Creates and initializes an ORB instance – ORB orb = ORB.init(args, null);  Creates a servant instance (the implementation of one CORBA Hello object) – HelloImpl helloImpl = new HelloImpl();  Obtain a reference for the desired object and register it with ORB – By creating a tie with the servant being the delegate(Tie model) – By a naming context (Inheritance model)  "Stringify" the reference – String ior = orb.object_to_string(hello);  Waits for invocations of the new object from the client – orb.run(); – Thread.currentThread().join();
  • 32. Step 4: implement the server  Note: to use a CORBA object, you must posses a valid reference to it. An object reference may be obtained in one of three ways: – CORBA::ORB::resolve_initial_references( <class-name> ) returns a reference to the specified class if the ORB can find it – Invoking a "factory" method on an object whose reference you already have (a "factory" creates other objects) – Converting a "stringified" reference to a real reference  the preferred way to obtain an object reference is the latter 32
  • 33. Step 5: write a client 33  Creates and initializes an ORB instance – ORB orb = ORB.init(args, null);  Obtain a reference for the desired object from IOR. – read stringified object from IOR – resolve the Object Reference(by HelloHelper.narrow() method)  "Invokes the object's sayHello() operations and prints the result
  • 34. Step 6: run the application  Compile the .java files, including the stubs and skeletons – javac *.java HelloApp/*.java  Start orbd – orbd -ORBInitialPort 1050 -ORBInitialHost localhost&  Start the Hello server – java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost&  Run the client application – java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost 34
  • 35. 35 Advantages of CORBA  Object Location Transparency  Server Transparency  Language Transparency  Implementation Transparency  Architecture Transparency  Operating System Transparency  Protocol Transparency
  • 36. References  Java IDL: The "Hello World" Example With The ImplBase Server-Side Model (old version)  Java IDL: The "Hello World" Example  Java IDL: The "Hello World" Example With The ImplBase Server-Side Model  CORBA Tutorial  Locating CORBA objects using Java IDL 36