SlideShare une entreprise Scribd logo
1  sur  37
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

Contenu connexe

Tendances

Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
Aman Jain
 

Tendances (20)

82159587 case-study-on-corba
82159587 case-study-on-corba82159587 case-study-on-corba
82159587 case-study-on-corba
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Type constructor
Type constructorType constructor
Type constructor
 
Java rmi
Java rmiJava rmi
Java rmi
 
Adbms 11 object structure and type constructor
Adbms 11 object structure and type constructorAdbms 11 object structure and type constructor
Adbms 11 object structure and type constructor
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Corba
CorbaCorba
Corba
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
Java RMI
Java RMIJava RMI
Java RMI
 
Temporal databases
Temporal databasesTemporal databases
Temporal databases
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Adbms 17 object query language
Adbms 17 object query languageAdbms 17 object query language
Adbms 17 object query language
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Rmi presentation
Rmi presentationRmi presentation
Rmi presentation
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 

En vedette

RMI and CORBA Why both are valuable tools
RMI and CORBA Why both are valuable toolsRMI and CORBA Why both are valuable tools
RMI and CORBA Why both are valuable tools
elliando dias
 
CORBA Component Model
CORBA Component Model CORBA Component Model
CORBA Component Model
Elham Hormozi
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
Sandeep Ganji
 

En vedette (20)

Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBA
 
CORBA
CORBACORBA
CORBA
 
C O R B A Unit 4
C O R B A    Unit 4C O R B A    Unit 4
C O R B A Unit 4
 
RMI and CORBA Why both are valuable tools
RMI and CORBA Why both are valuable toolsRMI and CORBA Why both are valuable tools
RMI and CORBA Why both are valuable tools
 
Corba by Example
Corba by ExampleCorba by Example
Corba by Example
 
CORBA Programming with TAOX11/C++11 tutorial
CORBA Programming with TAOX11/C++11 tutorialCORBA Programming with TAOX11/C++11 tutorial
CORBA Programming with TAOX11/C++11 tutorial
 
java 6 (rmi-corba) education
java 6 (rmi-corba) educationjava 6 (rmi-corba) education
java 6 (rmi-corba) education
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
 
Ipc
IpcIpc
Ipc
 
CORBA Component Model
CORBA Component Model CORBA Component Model
CORBA Component Model
 
Social crm
Social crmSocial crm
Social crm
 
Client server component
Client server componentClient server component
Client server component
 
Linux Firewall - NullCon Chennai Presentation
Linux Firewall - NullCon Chennai PresentationLinux Firewall - NullCon Chennai Presentation
Linux Firewall - NullCon Chennai Presentation
 
A Case Study In Social CRM Without Technology: The Green Bay Packers
A Case Study In Social CRM Without Technology: The Green Bay PackersA Case Study In Social CRM Without Technology: The Green Bay Packers
A Case Study In Social CRM Without Technology: The Green Bay Packers
 
Rhel4
Rhel4Rhel4
Rhel4
 
Interoperability
InteroperabilityInteroperability
Interoperability
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
 
Distributed Multimedia Systems(DMMS)
Distributed Multimedia Systems(DMMS)Distributed Multimedia Systems(DMMS)
Distributed Multimedia Systems(DMMS)
 
Chapter 17 corba
Chapter 17 corbaChapter 17 corba
Chapter 17 corba
 
Deployment
DeploymentDeployment
Deployment
 

Similaire à Corba introduction and simple example

Corba and-java
Corba and-javaCorba and-java
Corba and-java
afreen58
 
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
Jeff Krukin
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
hushu
 

Similaire à Corba introduction and simple example (20)

85305524 i-t-case-study
85305524 i-t-case-study85305524 i-t-case-study
85305524 i-t-case-study
 
CORBA.ppt
CORBA.pptCORBA.ppt
CORBA.ppt
 
Unit iv
Unit ivUnit iv
Unit iv
 
Corba and-java
Corba and-javaCorba and-java
Corba and-java
 
ADVANCED JAVA MODULE III & IV.ppt
ADVANCED JAVA MODULE III & IV.pptADVANCED JAVA MODULE III & IV.ppt
ADVANCED JAVA MODULE III & IV.ppt
 
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptx
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connection
 
Distributing computing.pptx
Distributing computing.pptxDistributing computing.pptx
Distributing computing.pptx
 
Corba model ppt
Corba model pptCorba model ppt
Corba model ppt
 
Distributed computing - november 2006
Distributed computing  - november 2006Distributed computing  - november 2006
Distributed computing - november 2006
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
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
 
Chapter2
Chapter2Chapter2
Chapter2
 
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
 
Common Object Request Broker Architecture
Common Object Request Broker ArchitectureCommon Object Request Broker Architecture
Common Object Request Broker Architecture
 
Corba in power system
Corba in power systemCorba in power system
Corba in power system
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
 
soap toolkit
soap toolkitsoap toolkit
soap toolkit
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
 
Ch-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptxCh-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptx
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Corba introduction and simple example

  • 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

Notes de l'éditeur

  1. IDL generates ‘stubs’ and ‘skeleton’ programs for each interface ‘Stub’ acts like a local function call, providing interface to ORB ‘Skeleton’ is server side implementation of IDL interface Skeletons and stubs return the results and error messages