CORBA 簡介
What is CORBA Common Object Request Broker Architecture Specification of a Standard Product of OMG(Object Management Group) Consortium 700+ companies Exception of Microsoft(Dcom) Middleware
Definitions Distributed:Dispersed across processes Hetrogeneous:Located on “different” machines Object Oriented computing.
Motivation behind CORBA Platform and Language dependant software Monolithic applications Consumers and Developers are tied
Goal of CORBA Interoperability Reusability Portability
The CORBA ORB Responsible for the communication between applications Middleware between servers and clients Handles the “talking” between applications
REPRESENTATION OF CORBA
The Client Object, Component or application Make requests for services from servers Can be a client for some requests and a server for other requests
The Server(Object Implementation) Provides a response to requests for services Can be a server for some requests and a client for other requests
The ORB core with IIOP(Internet Inter- Orb Protocol) ORB core Responsible for communicating requests Identify and locate objects Handle connection administration Deliver Data
ORB 可視為一種軟體的匯流排 (software bus) ORB 連接不同的物件,並隱藏了下列幾點: – 物件位置 – 物件實作 – 物件執行狀態 – 物件通訊機制 各廠商只要遵循 ORB 對外的界面標準,至於內部可以 由各廠商自行決定實作 ORB 的方法。 The ORB core with IIOP(Internet Inter- Orb Protocol)
IIOP developed by OMG Handles communication between ORBs on TCP/IP based networks ORBs should support IIOP in order to be CORBA compliant The ORB core with IIOP(Internet Inter- Orb Protocol) IIOP
IDL Client stubs IDL(Interface Definition Language) CORBA definition of an Interface(object) Create Client stubs and server skeletons when compiled IDL client stub A code written in IDL Use them 99.99% The other alternative is DII
Module { ; ; ; interface [: ] { ; ; ; ; [ ] ( ) [raises exception] [context]; } interface [: ] : } IDL(Interface Definition Language)
DII(Dynamic Invocation Interface) The other alternative to invoke a server operation Allow dynamic creation and invocation of requests to objects
The ORB Interface Collection of operations that provides services to servers and clients
The IDL server skeletons Correspondant to client stub on the server side. Provides the means by wich a server’s operations can be accessed Keeps the server from collapsing
The Dynamic Skeleton Interface (DSI) Corresponding to the DII on the server side.
The Dynamic Skeleton Interface (DSI) Corresponding to the DII on the server side.
Typical Client Method Call
Sequence of a method Call 1. Transforming the call into a request 2. Finding the server for the request 3. Preparing the server to receive the request 4. Communicating the data making up the request 5. Delivering the return reply
Transforming Method calls into requests 1. The client obtains an object reference for the server 2. The Client packages the reference,the method’s name & parameters and the type of return value 3. The Client executes the server’s method by calling the corresponding method in the Client stub 4. Inside the client stub the call is turned into a request 5. An ORB Interface operation is called to pass the request to the ORB
Finding the server for the request 1. ORB uses the information in the object reference to locate the server’s object 2. Determine the specific port number that the server object is accepting connections on
Preparing the server to receive the request ORB sends a message to the server’s Object adapter via the IIOP “Activate” the server or ensure that it is already up and running
Communicating the data making up th request The client ORB sends the data to the server’s ORB The server skeleton turns the data into a target language specific method call The server skeleton performs the call on the server implementation
Delivering the return reply Changing the data back into the client machine form Send the data back to the Client ORB and ultimately to the Client stub
Object Management Architecture Application Objects Client Object Implementation Common Object Services (COSS) Common Facilities (CFA) Object Request Broker (ORB)