0% found this document useful (0 votes)
21 views4 pages

CS-687 - Lab 12

This lab introduces students to the principles and implementation of Common Object Request Broker Architecture (CORBA) for developing distributed object-oriented systems. Students will gain hands-on experience in designing and deploying distributed systems, including creating language-independent object interfaces and invoking remote methods. The lab also covers the client-server model, remote objects, and includes practical activities such as creating a Calculator Service with a defined interface.

Uploaded by

Minahil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

CS-687 - Lab 12

This lab introduces students to the principles and implementation of Common Object Request Broker Architecture (CORBA) for developing distributed object-oriented systems. Students will gain hands-on experience in designing and deploying distributed systems, including creating language-independent object interfaces and invoking remote methods. The lab also covers the client-server model, remote objects, and includes practical activities such as creating a Calculator Service with a defined interface.

Uploaded by

Minahil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CORBA (Common Object Request

Broker Architecture) LAB # 12

Lab Objective:
The objective of this lab is to introduce students to the principles and practical
implementation of Common Object Request Broker Architecture (CORBA), enabling them to
understand distributed object-oriented systems and develop applications that leverage
CORBA middleware for seamless communication between distributed objects.

Activity Outcomes:
Upon completing this lab, students will be proficient in designing, implementing, and
deploying distributed systems using CORBA, and they will have hands-on experience with
creating language-independent object interfaces, invoking remote object methods, and
managing object interactions within a distributed environment.

Instructor Note:
Before starting this lab, students should have a solid foundation in object-oriented
programming concepts, familiarity with at least one programming language (e.g., Java, C++),
and a basic understanding of network communication and middleware concepts to grasp the
principles of CORBA effectively.

Introduction:

Remote Procedure Call


Birrell and Nelson (1984)
To allow programs to call procedures located on other machines.‖
Effectively removing the need for the Distributed Systems programmer to worry about all the
details of network programming (i.e. no more sockets).
– It abstracts the communication interface to the level of a procedure call.
– Instead of working directly with sockets, the programmer has the illusion of calling a local
procedure, when in fact the arguments of the call are packaged up and shipped off to the
remote target of the call.
– RPC systems encode arguments and return values using an external data representation,
such as XDR.

CS-687 Parallel and Distributed Computing Page-77


Remote Method Invocation RMI– is an extension of local method invocation that allows an
object living in one process to invoke the methods of an object living in another process.

Remote Objects

• Objects that can receive remote method invocations are called remote objects and they
implement a remote interface.

Client Server Model

• Client side: Send a request to server to execute a particular method of an object. Typical
client application gets a remote reference to one or more remote objects in the server and
then invokes methods on them.

• Server: Objects define an interface which defines the methods of objects to be used. So with
interface it will be identified that method has been called properly or not. : A typical server
application creates a number of remote objects, makes references to those remote objects
accessible, and waits for clients to invoke methods on those remote objects.

Service and Remote Interface

• Service Interface: In client server model, each server provides a certain set of procedures
to the clients.
• Remote Interface: Specifies functions of an object accessible to the outside world. Can
pass
• objects as arguments & return object as results.
• RMI provides the mechanism by which the server and the client communicate and pass
• information back and forth.
• Such an application is sometimes referred to as a distributed object application

CS-687 Parallel and Distributed Computing Page-78


Distributed object applications need to:

• Locate remote objects


• Communicate with remote objects
• Load class byte-codes for objects that are passed as parameters or return values

Task:
• We will create a Calculator Service that will provide some basic arithmetic functions to
its client. We
• Therefore, need to define an interface, its implementation, the server and the clients.

First Step:
• Create Calculator Interface

public interface Calculator extends java.rmi.Remote {


public long add(long a, long b)
throws java.rmi.RemoteException;
public long sub(long a, long b)
throws java.rmi.RemoteException;
public long mul(long a, long b)
throws java.rmi.RemoteException;
public long div(long a, long b)
throws java.rmi.RemoteException;
}

CS-687 Parallel and Distributed Computing Page-79


Activity-1:
Write the above code in IDE and compile it.

Solution:

Output Screenshot:

Activity-2:
What is the purpose of adding extends java.rmi.Remote.

Solution:

Output Screenshot:

Activity-3:
Will the code still be compiled if we remove throws java.rmi.RemoteException. Write your
observation

Solution:

Output Screenshot:

CS-687 Parallel and Distributed Computing Page-80

You might also like