Professional Documents
Culture Documents
UNIT – V
Features of SOM:
1. Support for Metaprogramming.
2. Support for Binary Compatability.
Metaprogramming:
In Metaprogramming model ,every class is itself an object and also an instance of
metaclass.
SOM allows classes to be constructed or modified dynamically.
For example, it is possible to add a new method to an existing class without disturbing
any other instances of the class.
The existing instances will immediately support the new method.
At present no other component supports this level of metaprogramming.
Though runtime coding is supported by CLR and Java, these donot support
modifications that affect already existing instances.
Binary Compatability:
SOM guarantees binary compatibility across a large number of base class changes.
SOM also guarantees that, if no interface changes took place, then building the
nextrelease of a component is guaranteed to preserve binary compatibility withclients
compiled against the previous release.
This effectively solves the syntactic FBC problem.
The OMG comprises over 700 companies and organizations, including almost all the
major vendors and developers of distributed object technology, including platform,
database, and application vendors as well as software tool and corporate developers.
Java IDL is an implementation of the standard IDL-to-Java mapping and is provided
by Sun in version 1.3 of Java 2 and is compliant with CORBA 2.x specification. Java
IDL provides an Object Request Broker, or ORB.
The ORB is a class library that enables low-level communication between Java-IDL
applications and other CORBA-compliant applications.
Like RMI, Java IDL gives you a way to access remote objects over the network. It
also provides tools you need to make your objects accessible to other CORBA clients.
A remote object can: find this object, call methods on it, and receive data from it, just
as if it were running on the client’s local machine.
Unlike RMI, objects that are exported using CORBA can be accessed by clients
implemented in any language with an IDL binding (C, C++, Ada etc.).
The CORBA standard is extensive and provides a rich set of services.
Several vendors provide CORBA products for various programming languages. The
CORBA products that support the Java programming language include:
The Java 2 ORB The Java 2 ORB comes with Sun's Java 2. It is missing
several features. The main feature it has is the ability to
look up an object by name.
The major components that make up the CORBA architecture include the:
Interface Definition Language (IDL), which is how CORBA interfaces are defined,
Object Request Broker (ORB), which is responsible for all interactions between
remote objects and the applications that use them,
The Portable Object Adaptor (POA), which is responsible for object
activation/deactivation, mapping object ids to actual object implementations.
Naming Service, a standard service in CORBA that lets remote clients find remote
objects on the networks, and
Inter-ORB Protocol (IIOP).
This figure 5.1 shows how a one-method distributed object is shared between a
CORBA client and server to implement the classic "Hello World" application.
Any relationship between distributed objects has two sides: the client and the server.
The server provides a remote interface, and the client calls a remote interface.
These relationships are common to most distributed object standards, including RMI
and CORBA.
On the client side, the application includes a reference for the remote object.
The object reference has a stub method, which is a stand-in for the method being
called remotely.
The stub is actually wired into the ORB, so that calling it invokes the ORB's
connection capabilities, which forwards the invocation to the server.
On the server side, the ORB uses skeleton code to translate the remote invocation
into a method call on the local object.
The skeleton translates the call and any parameters to their implementation-specific
format and calls the method being invoked.
When the method returns, the skeleton code transforms results or errors, and sends
them back to the client via the ORBs.
In addition to these simple distributed object capabilities, CORBA-compliant ORBs
can provide a number of optional services defined by the OMG.
These include services for looking up objects by name, maintaining persistent
objects, supporting transaction processing, enabling messaging, and many other
abilities useful in today's distributed, multi-tiered computing environments.
Several ORBs from third-party vendors support some or all of these additional
capabilities.
The ORB provided with Java IDL supports one optional service, the ability to locate
objects by name.
To give an idea of why CORBA ORBs make such great client/server middleware, the
following list of benefits that every CORBA ORB provide:
Static and dynamic method invocation. A CORBA ORB lets you either statically
defines your method invocation at compile time, or it lets you dynamically discover
them at run time. So you either get strong type checking at compile time or maximum
flexibility associated with late (or run-time) binding. Most other forms of middleware
only support static bindings.
High-level language binding. A CORBA ORB lets you invoke methods on server
object using your high-level language of choice. It doesn’t matter what language ,
server object are written in. CORBA separated interface from implementation and
provides language-neutral data types that make it possible to call objects across
language and operating system boundaries. In contrast, other types of middleware
typically provide low-level, language-specific, API libraries. And they don’t separate
implementation from specifications- the API is tightly bound to the implementation,
which makes it very sensitive to changes.
Self-describing system. CORBA provides run-time metadata for describing every
server interface known to the system. Every CORBA ORB must support an Interface
CORBA1.1 was only concerned with creating portable object application; the
implementation of the ORB core was left as an “exercise for the vendors.” The result was
some level of components portability, but not interoperability.
CORBA 2.0 specifies CE as the first of many optional ESIOPs (Pronounced “E-SOPs”).
The DCE ESIOP provides a robust environment for mission-critical ORBs.
functionality of the ORB. You use them to create a component, name it, and introduce it into
the environment.
The Life Cycle Services defines operations for creating, copying, moving, and
deleting components on the bus.
The Persistence Service provides a single interface for storing components
persistently on a variety of storage servers, including Object Databases (ODBMSs),
Relational Databases (RDBMSs), and simple files.
The Naming Service allows components on the bus to locate other components by
name; it also supports federated naming contexts. The service also allows objects to
be bound to existing network directories or naming contexts, including ISO’s X.500,
OSF’s DCE, Sun’s NIS+. Novell’s NDS, and the Internet’s LDAP.
The Event Service allows components on the bus to dynamically register or
unregister their interest in a specific event. The service defines a well-known object
called an event channel that collects and distributes events among components that
know nothing of each other.
The Concurrency Control Service provides a lock manager that can obtain locks on
behalf of either transactions or threads.
The Transaction Service provides two phase commit coordination among
recoverable components using either flat or nested transactions.
The Relationship Service provides a way to create dynamic associations(for links)
between components that know nothing of each other. It also provides mechanisms
for traversing the links that group these components. You can use the service to
enforce referential integrity constraints, track containment relationship, and for any
type of linkage among components.
The Externalization Service provides a standard way foe getting data into and out of
a component using a stream-like mechanism.
The Query Service provides query operations for objects. It’s a superset of SQL. It is
based on the oncoming SQL3 specification and the Object Database Management
Group’s (ODMG) Object Query Language (OQL).
The Licensing Service provides operations for metering the use of components to
ensure fair compensation for their use. The service supports any model of usage
control at any point in a component’s life cycle. It supports charging per session, per
node, per instance creation, and per site.
The Properties Service provides operations that let you associate named values (or
properties) with any component. Using this service, you can dynamically associate
properties with a component’s state.
The Time Service provides interfaces for synchronizing time in a distributed object
environment. It also provides operations for defining and managing time-triggered
events.
The Security Service provides a complete framework for distributed object security.
It supports authentication, access control lists, confidentially, and non-repudiation. It
also manages the delegation of credentials between objects.
The Trade Service provides a “yellow Pages” for objects; it allows objects to
publicize their services and bid for jobs.
The Collection Service provide CORBA interfaces to generically create and
manipulate the most common collection.
All these services enrich a distributed component’s behavior and provide the robust
environment in which it can safely live and play.
5.6 IIOP
RMI-IIOP (read as "RMI over IIOP") denotes the Java Remote Method Invocation
(RMI) interface over the Internet Inter-Orb Protocol (IIOP).
It is based on two specifications: the Java Language Mapping to OMG IDL, and
CORBA/IIOP 2.
It was developed by Sun Microsystems and IBM, combining features of Java RMI
technology with features of CORBA technology.3.1.
IIOP is CORBA's communication protocol.
IIOP allows clients using a CORBA product from one vendor to communicate with
objects using a CORBA product from another vendor thus permitting interoperability,
which is one of the goals of the CORBA standard.
It defines the way bits are sent over a wire between CORBA clients and servers.
Interfaces to remote objects are described in a platform-neutral interface definition
language (IDL).
The IIOP protocol connects CORBA products from different vendors, ensuring
interoperability among them.
There were two major prerequisites that shaped the design of the RMI-IIOP protocol:
Interface: exposes to the client what methods can be invoked on an object and what
are their parameters
RMI-IIOP masks weather the object you are invoking is local or remote
Uses a stub to accept method calls locally and delegate those calls to the actual object
implementation which might reside across the network
Uses a skeleton on the remote host to receive calls over the network and delegate the
calls to the object implementation.
Stubs and skeletons are automatically generated by a tool, called rmic, provided as
part of the Java RMI-IIOP implementation is shown in figure 5.3.
Java RMI-IIOP uses serialization for passing parameters via remote method
invocation.
- The stub for the remote object is serialized and passed by-value.
- All primitive types are serializable and will be serialized unless marked as
transient
Advantages:
Interoperability
Disadvantages:
Need to learn Interface Definition Language (IDL)
Complex Programming
IIOP is a high-level protocol that takes care of many of the services associated with
the levels above the transport layer, including data translation, memory buffer
management, dead-locks and communication management as shown in figure 5.4.
It is also responsible for directing requests to the correct object instance within an
ORB.
CORBA and IIOP assume the client-server model of computing in which a client
program always makes requests and a server program waits to receive requests from
clients.
For a client to make a request of a program somewhere in a network, it must have an
address for the program (object instance).
This address is known as the Interoperable Object Reference (IOR). Part of the
address is based on the server's IP address and port number. In the client's computer, a
table can be created to map IORs to proxy names that are easier to use.
A Common Data Representation (CDR) provides a way to encode and decode data so
that it can be exchanged in a standard way.
The client application can access the object using the IOR, which masks the client
application’s ORB implementation from the ORB implementation used to host the
CORBA object.
The services that an object provides are given by its interface. Interfaces are defined
in OMG's Interface Definition Language (IDL).
IDL is independent of any programming language.
Mappings from IDL to specific programming languages are defined as part of the
CORBA specification.
Mappings for C, C++, Smalltalk, Ada, COBOL, and Java have been approved by
OMG.
Figure 5.5 shows the general structure of IDL.
The syntax of both Java and IDL were modeled to some extent on C++, so there are a
lot of similarities between the two in terms of syntax.
However, there are differences between IDL and Java.
In IDL, you declare only the names and types for interfaces, data members, methods,
method arguments etc.
The method implementations are created in implementation language you choose after
you’ve used an IDL compiler (idlj is the IDL compiler for Java) to convert your IDL
interface to your target language.
When you run theidlj compiler over your interface definition file, it generates the
Java version of the interface, as well as the class code files for the stubs and skeletons
that enable your applications to hook into the ORB.
IDL includes, like C++, non-class data structure definitions like structs, unions etc.
(these are not part of Java).
Method parameters in IDL include modifiers that specify whether they are input,
output, or input/output variables.
In Java, all primitive data types are passed by value, and all objects are passed by
reference.
An IDL file can include multiple public interfaces.
Java allows multiple inner classes within a single public class definition and multiple
nonpublic classes per file, but only a single public class can be defined in a given
Java file.
Modules, which are similar to Java packages, can be nested within other modules in
the same IDL file.
In Java, you can define a class only within a single package in a single Java file.
The POA connects the server object implementation to the ORB. It extends the
functionality of the ORB and some its services include:
The main function of a CORBA object adapter is to mediate between an ORB and the
object receiving incoming calls and returning results.
An instance of the portable object adapter accepts requests on behalf of a group of
objects.
Fig.5.6 Generation of stub, POA skeleton, and servant template from given IDL
specification
Ports that are classified into facets, receptacles, event sources, and event sinks.
A facet is a provided interface and a receptacle is a required interface.
A component instance’s receptacles are connected to other instances’ facets.
Event sources and sinks are similar, but instead of being connected to each other, they
are both connected to event channels.
Receptacles provide connect and disconnect operations and internally correspond to
object references to other objects of appropriate type.
Configuration interfaces support initial configuration of new component instances.
TWO MARKS
Interface definition
Location and possible activation of remote objects
Communication between clients and object
Stubs Skeletons
Stubs are called client side proxy Skeletons are called server side
objects. stubs.
It forwards all invocations through It directly invokes the target
the ORB to the real target object. method.