Professional Documents
Culture Documents
Introduction
After few months it became international organization Currently approx 470 members
It provides a structure whereby its members specify technology and then produce commercial implementations complying with those specifications It emphasizes cooperation among members
OMGs goals
Promotion of object-oriented approach to software engineering Definition of an architecture for the distribution and cooperation of OO software components in heterogeneous, distributed environment Contrary to other organizations (like Open Software Foundation), OMG doesnt produce software; rather, it defines standards (guideline, specifications, architectural models) Compliance to specifications assures portability
How it works
Task forces issue Request For Proposal (RFP)
Detailed statements about a problem that needs to be solved Current RFP http://www.omg.org/public_schedule/
Response are solicited in terms of IDL specifications with semantic in English The most suitable specification is selected and presented to the tasks force controlling committee ..
Examples
Agent Metamodel and Profile (AMP) RFP (document ad/2008-09-05) Concrete Syntax for a UML Action Language RFP (document ad/2008-09-09) Date-Time Foundation Vocabulary RFP (document bmi/2008-03-02) Decision Support Service RFP (document health/2007-03-01) Diagram Definition RFP (document ad/2007-09-02) Event Metamodel and Profile (EMP) RFP (document ad/2008-09-15) SwA Evidence Metamodel RFP (document swa/2007-09-03) TACSIT Controller Service RFP (document c4i/2007-06-16) UML Profile for Advanced and Integrated Telecommunication Services RFP (document mars/2008-06-09) UML Profile for XBRL Global Ledger Framework RFP (document finance/2008-1202) Value Delivery Metamodel (VDM) RFP (document bmi/2009-03-09)
Example
A well known example is the UML language UML (last specification)
Reference Model
Architectural framework Relevant to application programmers
Defines the main concepts of the model These definitions are extended with component to provide a more concrete specialization of the model The core plus one ore more component is called a profile
Objects
Model of entities or concepts
A document, date, compiler,
Objects have an identity, fixed for the whole lifecycle, which is independent of the objects properties or behavior This identity is represented by an object reference
We will later see how the CORBA profile specifies this concept
Operations, signature,
An operation is a behavior that the object offers to the outside world through its signature
Sending a request to an object = invoking an operation on the object
Operation, signature,
Operations may cause side-effects (change in the objects state) Exceptions are returned when the operation cannot be executed
Exceptions are defined in the CORBA profile
Nonobject type
They are usually called data types
Example of inheritance
Inheritance
If interface A inherits from B, then A offers the same set of operations and may also offer some additional one This relationship explicitly relate A to B
The fact that the operations in A is a superset of those in B in not a coincide
ORB
ORB is defined in the Common Object Request Broker Architecture and Specification (CORBA) document CORBA builds on the OMA Core Object Model
Syntax and Semantic of an IDL Framework for interoperability Set of language mappings from IDL to languages (C, C++, COBOL, Smalltalk,Ada95,java,lisp,Python)
Object services
Set of interface specifications to fundamental services for OO distributed applications The brand name is CORBAServices
Naming Notification Lifetime Transaction Concurrency .
Common Facilities
User-oriented interface providing facilities across application domains They are referred to as CORBAfacilities
Time Facility Printing Facility ..
Domain Interface
A.k.a. Vertical facilities Domain specific interfaces
Issued by the Domain Task Force
CORBA - overview
Location transparency
Ability to access and invoke operations on CORBA objects (defined from the core object model plus specific profile) without the need of knowing where they reside
ORB interface
ORB interfaces are specified in IDL
Certain interfaces are designed as pseudo-IDL, meaning that they are not CORBA objects nor data types Pseudo-IDL interface may be implemented as pseudo-objects (they may correspond to libraries) Pseudo-objects are invoked as normal objects, but their reference cannot be passed as a parameter
Servant
Programming language entity implementing the operations defined by an IDL A CORBA Object can be incarnated by different Servant over its lifetime
Object reference
Identity used to invoke operations Handle to an object Can be passed as parameters They are opaque
Enough information for the ORB to send a request to the correct servant, but this information is inaccessible to the user
Interface
Group of operations Support of inheritance mechanism One-to-one mapping between Object and interface CORBA Component Model (CCM) allows objects to have many interfaces
Principal interface is the most specific interface than an object can support
Types
Object types
Support an interface All inherits from the CORBA Object
Valuetypes
Like an interface, but can define a state accessible to the client Local implementation passed by value
Basic types
Integer, char,
Operation semantics
At-most-once
ORB conveys the arguments to the object implementation and returns the result (if any) to the requester The requester is blocked waiting for the reply (or exception is raised) Executed exactly once (if no exception), and no more than once if an exception occurs
Operation semantic
Best effort
The requester doesnt wait for the operation to complete Signature is through oneway keyword
Must return void, cannot contain in out nor inout parameter (see later)
Deferred-synchronous
Send the request without blocking Polling the reply
Signature
string SayHello(in string sn) raises (Invalid);
[oneway] returned type | operation_identifier [list of parameters] [context]
ORB Structure
Interface Repository
Implementation Repository
Client stub
Automatically generated from the IDL interface Must be linked to the client program invoking the operation In OO the stub is instantiated as a local proxy object that delegates invocation on its methods to the remote implementation Convert local representation to external representation
Marshalling / Unmarshalling
Different semantics
At-most-once and deferred-synchronous
Implementation skeleton
Invoke the right method on the implementation object Automatically generated from IDL definition
Stringified OR
module CORBA { types interface ORB { //PIDL string object_to_string(in Object obj); Object string_to_object(in string obj); //others.. } input parameter }
Managing Objects
module CORBA { interface Object { InterfaceDef get_interface(); //from Interface repository boolean is_nil(); //this denotes no object Object duplicate(); void release(); boolean is_a(in string logical_type_id); boolean is_equivalent(in Object other_object); unsigned long hash(in unsigned long maximum); Policy get_policy(in PolicyType policy_type); Object set_policy_ovverrides(in PolicyList policies, in SetOverrideType set_add); DomainManagerList get_domain_managers(); //. } }
Managing Objects
module CORBA { interface Object { InterfaceDef get_interface(); //from Interface repository boolean is_nil(); //this denotes no object Object duplicate(); void release(); boolean is_a(in string logical_type_id); boolean is_equivalent(in Object other_object); unsigned long hash(in unsigned long maximum); Policy get_policy(in PolicyType policy_type); Object set_policy_ovverrides(in PolicyList policies, in SetOverrideType set_add); DomainManagerList get_domain_managers(); //. } }
Managing Objects
module CORBA { interface Object { InterfaceDef get_interface(); boolean is_nil(); Object duplicate(); void release(); boolean is_a(in string logical_type_id); boolean is_equivalent(in Object other_object); unsigned long hash(in unsigned long maximum); Policy get_policy(in PolicyType policy_type); Object set_policy_ovverrides(in PolicyList policies, in SetOverrideType set_add); DomainManagerList get_domain_managers(); //. } }
Invalid OR copy
1. OR is a reference to the Proxy 2. OR1 is created by the copy feature of the language 3. The proxy is not aware that is it pointed by two references (its reference count remains 1) 1. CORBA:relase() decreases the reference count to zero 2. The proxy assumes that no one points to it; then it de-allocates the resources and destroys itself!
1. Client invokes op on OR1 2. The operation returns another reference, which is a duplicate of the local reference OR2
1. A new local proxy is created; this means that the code has to be already available or it should somehow retrieved (e.g., Javas dynamic class downloading )
Invalid OR deletion
Managing Objects
module CORBA { interface Object { InterfaceDef get_interface(); Check if the Interface boolean is_nil(); Repository ID refers to Object duplicate(); a subtype of this void release(); object (use narrow) boolean is_a(in string logical_type_id); boolean is_equivalent(in Object other_object); hash of unsigned long hash(in unsigned long maximum); maximum size Policy get_policy(in PolicyType policy_type); of a reference Object set_policy_ovverrides(in PolicyList policies, in SetOverrideType set_add); DomainManagerList get_domain_managers(); //. } }
Managing Objects
module CORBA { interface Object { InterfaceDef get_interface(); boolean is_nil(); Object duplicate(); void release(); boolean is_a(in string logical_type_id); boolean is_equivalent(in Object other_object); unsigned long hash(in unsigned long maximum); Policy get_policy(in PolicyType policy_type); Object set_policy_ovverrides(in PolicyList policies, in SetOverrideType set_add); DomainManagerList get_domain_managers(); //. } }
ORB initialization
module CORBA { // typedef string ORBid; typedef sequence<string> arg_list; ORB ORB_init(inout arg_list argv,in ORBid orbid); // interface ORB{ typedef string ObjectId; typedef sequnce <ObjectId> ObjectIdList; exception InvalidName{}; ObjectIdList list_initial_services(); Object resolve_initial_references (in ObjectId identifier) raises InvalidName } }
ORB initialization
The ORB is accessible as a pseudo-object Its reference in returned by ORB_init
It is not invoked on any object (bootstrap) Receives a configuration string and the name of the ORB from the command shell
Once the ORB is obtained, it is possible to know the basic services and facilities it supports and get a reference to them
ORB initialization
module CORBA { // typedef string ORBid; typedef sequence<string> arg_list; ORB ORB_init(inout arg_list argv,in ORBid orbid); // interface ORB{ typedef string ObjectId; typedef sequnce <ObjectId> ObjectIdList; exception InvalidName{}; ObjectIdList list_initial_services(); Object resolve_initial_references (in ObjectId identifier) raises InvalidName } }
Bootstrap process
Once the services are known, it is necessary to get an object reference to them This is achieved using a bootstrap operation with the name of the service as argument
CosNaming::NamingContext (Cos = Corba service) CosTrading::Lookup .
ORB initialization
module CORBA { // typedef string ORBid; typedef sequence<string> arg_list; ORB ORB_init(inout arg_list argv,in ORBid orbid); // interface ORB{ typedef string ObjectId; typedef sequnce <ObjectId> ObjectIdList; exception InvalidName{}; ObjectIdList list_initial_services(); Object resolve_initial_references (in ObjectId identifier) raises InvalidName } }
POA architecture
Servant: Implementation providing run-time semantics of one or more CORBA objects Object ID: ID used by a POA to identify an abstract object Active Object MAP: ServantObject ID table used to dispatch incoming requests Incarnation: Servant serving the request of an object (incarnates the object) Etherealizion: Destroying the object ID servant association Default Servant: Servant to which all incoming requests of object ID not in the AO Map are dispatched
POA architecture
Servant: Implementation providing run-time semantics of one or more CORBA objects Object ID: ID used by a POA to identify an abstract object Active Object MAP: ServantObject ID table used to dispatch incoming requests Incarnation: Servant serving the request of an object (incarnates the object) Etherealizion: Destroying the object ID servant association Default Servant: Servant to which all incoming requests of object ID not in the AO Map are dispatched
POA architecture
Servant: Implementation providing run-time semantics of one or more CORBA objects Object ID: ID used by a POA to identify an abstract object Active Object MAP: ServantObject ID table used to dispatch incoming requests Incarnation: Servant serving the request of an object (incarnates the object) Etherealizion: Destroying the object ID servant association Default Servant: Servant to which all incoming requests of object ID not in the AO Map are dispatched
POA architecture
Servant: Implementation providing run-time semantics of one or more CORBA objects Object ID: ID used by a POA to identify an abstract object Active Object MAP: ServantObject ID table used to dispatch incoming requests Incarnation: Servant serving the request of an object (incarnates the object) Etherealizion: Destroying the object ID servant association Default Servant: Servant to which all incoming requests of object ID not in the AO Map are dispatched
POA architecture
Servant: Implementation providing run-time semantics of one or more CORBA objects Object ID: ID used by a POA to identify an abstract object Active Object MAP: ServantObject ID table used to dispatch incoming requests Incarnation: Servant serving the request of an object (incarnates the object) Etherealizion: Destroying the object ID servant association Default Servant: Servant to which all incoming requests of object ID not in the AO Map are dispatched
POA Manager
Encapsulate the processing state of one or more POAs Requests associated to the POA are discarded, queued or served
Dynamic activations
Interoperable Object Reference (IOR): Application wide unique ID generated by the POA Adapter activator: May create a POA on demand, if the POA responsible for an object is not active Servant Manager: create servant on-demand (may be of two types: servant locator and servant activator see later)
Root POA
Created and managed by the ORB Available at the application through the initialization interface resolve_initial_references Application may register servant with root POA, or create other child POAs to manage servant with higher flexibility
POA Policy
Object ID uniqueness policy
One or many Object-ID refer to the same servant object
Lifespan policy
Determines if CORBA objects are transient or persistent (outlive after POA is destroyed and created again)
ID assignment
Generated automatically (by the ORB) or by the programmer If automatically generated and the POA lifespan is persistent, the ID must also be unique across all the instantiation of the same POA
POA Policy
Servant Retention policy
Keeps the Object ID servant association in the Active Object MAP or establish a new ObjectID/servant association each time a new request arrives (through activators)
POA policy
Request processing policy
Consult only the AOM
Object not found error reported to the client
POA Policy
POA-controlled Threading policy
Single thread: Multithread
POA processing
1. Locate the server process
IOR contains Host name and port number Or create a new server process on-demand (from the implementation repository) IOR contains an object key (Object-ID + POA name)
Layered Demultiplexing
High overhead, especially in number of objects is high
Priority inversion may occur FIFO dispatching strategy (not Qos based)
Perfect hashing
Low demux latency, O(1) Only for static objects
Active demux
OA dispatch based a (possibly dynamically) offeset Low cost, O(1)
2. 3.
4. 5.
from
6.
The demux may use the select() system call that examines a set of I/O descriptors and returns when at least one event occurs (3,4)
Reactor dispatches (callback) the handler of the event and the associated data (5) . As an event occurred the operation is not blocked
When an event occurs, the leader promotes a follower to become the new leader and processes the event itself or hand-offs the event to a follower thread in the thread set
An example, TAO
1. Query the client ORBs connection for exiting connection to the server S designated in the IOR
2. Create a new connection to S (if required) 3. Add connection to the cache 4. Add connection handle to the reactor 5. Accept a new connection 6. Add C to the cache (bidirectional) 7. Also add C to the reactor
c
An example, TAO
9. Allocate memory for marshalling 10. Send the marshalled data