summaryrefslogtreecommitdiff
path: root/trunk/TAO/tests/OBV/Supports/README
blob: e708dff9ed8d0f3c95a72aed55e02260a90e2605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// $Id$

The Supports_Test example tests the ability of valuetypes to support concrete
interfaces. Valuetypes are manipulated both as normal valuetypes and as object
references.

Since operations of a supported interface are mapped to pure virtual methods in
the valuetype (and are not inherited), an application using this feature should
probably not define an implementation of the interface. Doing so will result in
multiple implementations of the same method - one for objects of the interface,
and one for valuetypes - and clients will have no way to distiguish between the
two, other than narrowing objects of the interface type to the
valuetype. Instead, one can leave the interface unimplemented, and only define
implementations of its methods in the valuetype.

The steps are as follows:

1. Activate a POA in which the valuetype will reside and create the valuetype.
2. Call the valuetype's "_this ()" method, which is inherited from the skeleton
   class of the supported interface. This will return an active object reference
   to an object that is the type of the supported interface.
3. This object reference can be passed as a parameter and supports remote
   operation invokations.

Supports_Test checks proper operation of the following features:
-Valuetypes that support concrete interfaces:
   Using the same valuetype implementation, Supports_Test creates both
   valuetypes and object references, passes them as parameters, and
   invokes both local and remote calls.
-ORB::register_value_factory () return values:
   Supports_Test checks the return values of register_value_factory () to
   ensure compliance with the spec.