Presentation is loading. Please wait.

Presentation is loading. Please wait.

CORBA Celsina Bignoli Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set.

Similar presentations


Presentation on theme: "CORBA Celsina Bignoli Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set."— Presentation transcript:

1 CORBA Celsina Bignoli bignolic@smccd.net

2 Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set of SW components –programmers with very different skill sets –need to maintain legacy code –desire to avoid vendor lock-in

3 What is CORBA CORBA (Common Object Request Broker Architecture) cross-platform, cross-language, vendor- independent specification for object-based distributed computing Introduced by the Object Management Group (OMG) in 1989

4 OMG The OMG is a consortium that comprises over 700 companies and organizations –almost all the major vendors and developers of distributed object technology platforms databases software tools –corporate application developers

5 CORBA CORBA can be thought as a language- independent version of RMI –similar lifecycle including definition of interfaces, generation of stubs and skeletons glues together application written in different languages on different platforms –interfaces must be specified in a language- independent format

6 CORBA Architecture ServerClient Stub Skeleton Network Invokes methods implemented by the server Marshalls invocation and sends data to skeleton Un-marshalls data and invokes method on server

7 CORBA Components Interface Definition Language (IDL) Wire Protocol (IIOP) Language Mappings

8 CORBA Architecture ServerClient StubSkeleton IIOP Invokes methods generated from IDL (implemented by the server) Marshalls invocation and sends data to skeleton Automatically generated from IDL Un-marshalls data and invokes method on server Automatically generated from IDL ORB

9 The ORB is the distributed service that implements the request to the remote object. –It locates the remote object on the network –communicates the request to the object –waits for the results and when available communicates those results back to the client. The ORB implements location transparency. –Exactly the same request mechanism is used by the client and the CORBA object regardless of where the object is located. The ORB implements programming language independence for the request. –The client issuing the request can be written in a different programming language from the implementation of the CORBA object

10 ORBDescription Java 2 ORBcomes with Sun's Java 2 SDK VisisBroker for JavaA popular Java ORB from Inprise Corporation. VisiBroker is also embedded in other products OrbixWebA popular Java ORB from Iona Technologies WebSphereA popular application server with an ORB from IBM Netscape Communicatorhas a version of VisiBroker embedded in it Shareware ORBsAvailable from various websites CORBA Products

11 Interface Definition Language (IDL) Used to specify an object interface, i.e. the contract between code using the object and the code implementing the object indicates the operations the object supports, but not how they are implemented –the implementation of a CORBA object is provided in a standard programming language, such as the Java or C++ clients only depend on the interface IDL interfaces are programming language neutral

12 Interface Definition Language(2) OMG IDL allows you to define the following : –Modularized object interfaces –Operations and attributes that an object supports –Exceptions raised by an operation –Data types of an operation return value, its parameters, and an object's attributes

13 IDL Data Types Basic data types (long, short, string, float...) Constructed data types (struct, union, enum, sequence) Typed object references The any type, a dynamically typed value

14 Bindings IDL defines language bindings for many different programming languages –OMG has standardized on language bindings for: C, C++, Java, Ada, COBOL, Smalltalk, Objective C, and Lisp Developers can choose the appropriate programming language for the object implementation and a possibly different programming language for the client. IDL declarations are compiled with an IDL compiler and converted to their associated representations in the target programming languages according to the standard language binding

15 IDLJavaC++ modulepackagenamespace interface abstract class operationmethodmember function attributepair of methods exception IDL to Java Bindings

16 IDL TypeJava Type boolean char octetbyte short longint long float double stringString IDL to Java Data Type Mappings

17 HelloWorld Example Object Reference sayHello Hello World! Hello Client Hello Servant sayHello Hello Server Stub ORB TCP/IP (network) Skeleton ORB IIOP

18 Defining the Remote Interface create a file Hello.idl with the following content: module HelloApp { interface Hello { string sayHello(); oneway void shutdown(); };

19 Mapping Hello.idl to Java idlj -fall Hello.idl The tool idlj reads OMG IDL files and creates the required Java files. The idlj compiler defaults to generating only the client- side bindings. If you need both client-side bindings and server-side skeletons you must use the -fall option A directory called HelloApp has been created containing a number of files

20 Generated Files Hello.java –This interface contains the Java version of our IDL interface. –The Hello.java interface extends org.omg.CORBA.Object, providing standard CORBA object functionality. HelloPOA.java –This abstract class is the stream-based server skeleton –provides basic CORBA functionality for the server –The server class, HelloServant, extends HelloPOA. _HelloStub.java –This class is the client stub, providing CORBA functionality for the client. – Implements the Hello.java interface.

21 Generated Files HelloOperations.java –contains the methods sayHello() and shutdown(). –The IDL-to-Java mapping puts all of the operations defined on the IDL interface into this file, which is shared by both the stubs and skeletons HelloHelper.java –This class provides auxiliary functionality. – responsible for reading and writing the data types to CORBA streams HelloHolder.java

22 Developing the Server Create the servant class HelloImpl –implements of the Hello IDL interface; each Hello instance is implemented by a HelloImpl instance contains one method for each IDL operation, in this example, the sayHello() and shutdown() methods – it’s a subclass of HelloPOA, which is generated by the idlj compiler from the example IDL. Servant methods are just like ordinary Java methods; the extra code to deal with the ORB, with marshaling arguments and results, and so on, is provided by the skeleton

23 Portable Object Adapter (POA) Abstract layer between the wire and the skeleton responsible for –pull data from the wire –de-marshalling data –forward requests to skeletons

24 Naming Services The two options for Naming Services shipped with J2SE 1.5 are: orbd, which includes both a Transient Naming Service and a Persistent Naming Service. tnameserv - a Transient Naming Service. The example uses orbd.

25 Developing the Client needs to look up the server obtain a reference of the object on which it makes remote method calls unaware the object is –remotely located –written in a different language –serviced by a different vendor ORB

26 CORBA vs. RMI both frameworks for building distributed systems similar architectural principles CORBA supports components written in different programming languages RMI assumes client/server written in Java RMI easier to learn and use –code is smaller and simpler –serialization makes it easier to maintain an application CORBA unlike RMI has no notion of distributed garbage collection

27 Choosing CORBA vs. RMI Depends on how you can answer some questions –will the application need to communicate with components that are NOT written in Java? –would the extra CORBA infrastructure be useful? –Will all future code that needs to communicate with the application always be written in Java?

28 RMI/IIOP JRMP the native protocol of RMI is replaced with IIOP, the CORBA protocol

29 RMI/IIOP Applications Steps 1.Remote interface like in RMI extends Remote methods throw RemoteException 2.Server extends PortableRemoteObject instead of UnicatsRemoteObject 3.stubs and scheleton are generated using rmic with the –iiop flag 4.CORBA naming service used instead of RMI registry 5.IDL can be generated from Step 1 and used to develop non-Java components


Download ppt "CORBA Celsina Bignoli Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set."

Similar presentations


Ads by Google