CS-687 - Lab 12
CS-687 - 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 Objects
• Objects that can receive remote method invocations are called remote objects and they
implement a remote interface.
• 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 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
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
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: