Escolar Documentos
Profissional Documentos
Cultura Documentos
• Object has
– Attributes (data or state)
– Methods
1
Why Supporting Distributed
Objects?
• Object oriented paradigm
• Hide implementation details under object
interface (heterogeneity)
• Wrap procedures accessing legacy
systems as an object
2
+HOORLGO
LQWHUIDFH+HOOR^
VWULQJVD\+HOOR
`
Object hides
implementation
From: http://java.sun.com/docs/books/tutorial/idl/hello/index.html
details, providing
transparency
2EMHFWFDQEHPRYHG
DURXQGRQGLIIHUHQW
VHUYHUVRQGLIIHUHQW
SODWIRUPV
From: http://www.molecular.com/news/recent_articles/051904_javaworld.aspx
3
Method Call on Client Side
• Client application needs to get an object
reference first (say via naming service)
• Bind the object (load the proxy of the object in
the client’s address space)
• After binding, the method call can be invoked
Object Server
• Object server manages objects
• Object server provides a means to invoke
local objects based on requests from
remote clients and to route the request to
objects
• Object server is as a place for objects to
live
4
Persistent and Transient
Objects
• Persistent Object: Object that is continued to
exist outside the server process’s address space
State of the object is stored on secondary storage
after the server manages the object exits
5
Object adaptor for implementing a
specific activation policy
• An object adaptor may be
responsible for one or more
objects
6
Overview of CORBA Architecture
7
CORBA Services
Service Description
Collection Facilities for grouping objects into lists, queue, sets, etc.
Query Facilities for querying collections of objects in a declarative manner
Concurrency Facilities to allow concurrent access to shared objects
Transaction Flat and nested transactions on method calls over multiple objects
Event Facilities for asynchronous communication through events
Notification Advanced facilities for event-based asynchronous communication
Externalization Facilities for marshaling and unmarshaling of objects
Life cycle Facilities for creation, deletion, copying, and moving of objects
Licensing Facilities for attaching a license to an object
Naming Facilities for systemwide name of objects
Property Facilities for associating (attribute, value) pairs with objects
Trading Facilities to publish and find the services on object has to offer
Persistence Facilities for persistently storing objects
Relationship Facilities for expressing relationships between objects
Security Mechanisms for secure channels, authorization, and auditing
Time Provides the current time within specified error margins
From: http://java.sun.com/docs/books/tutorial/idl/hello/index.html
Hello.idl
LQWHUIDFH+HOOR^
VWULQJVD\+HOOR
`
From: http://www.molecular.com/news/recent_articles/051904_javaworld.aspx
8
Programming in CORBA
1. Create IDL using OMG IDL (CORBA IDL)
2. Use a language specific compiler to generate
IDL specific language code and other related
files
3. Develop the client program
4. Develop the server program
OMG IDL
• OMG IDL is purely declarative
– Provide syntax of interfaces
9
Development Process for BEA
Tuxedo CORBA Applications
http://e-docs.bea.com/tuxedo/tux80/getstart/build.htm#1024964
10
Writing Server Application
• Write the methods that // Implementation of the Simple_i::to_lower method which converts
implement the operations // a string to lower case.
char* Simple_i::to_lower(const char* value)
for each interface {
CORBA::String_var var_lower = CORBA::string_dup(value);
• Create the CORBA object for (char* ptr = var_lower; ptr && *ptr; ptr++) {
*ptr = tolower(*ptr);
server }
return var_lower._retn();
• Define object activation }
policies // Implementation of the SimpleFactory_i::find_simple method which
• Create and register a // creates an object reference to a Simple object.
11
Object Model
• ORB provides few services through ORB interface
• Operations to marshall and unmarshall object references
• Getting object reference to an object implementing a specific
CORBA service
Interoperability
Message type Originator Description
Request Client Contains an invocation request
Reply Server Contains the response to an invocation
LocateRequest Client Contains a request for the exact location of an object
LocateReply Server Contains location information on an object
CancelRequest Client Indicates client no longer expects a reply
CloseConnection Both Indication that connection will be closed
MessageError Both Contains information on an error
Fragment Both Part (fragment) of a larger message
12
GIOP Messages
• Request message contains a complete
marshaled invocation request (object reference,
name of the method, input parameters)
– Each request has request ID
13
Portable Object Adaptor (2)
14
Object References (1)
• The organization of an IOR with specific
information for IIOP
Security
information
• References:
– Tanenbaum V. Steen Distributed Systems Priciples and
Paradigms, Prentice Hall
– http://www.cs.wustl.edu/~schmidt/TAO.html
15