[Enterprise Extensions only]

CORBA value type considerations

The Java language to IDL specification maps Java serializables to CORBA valuetypes (pass-by-value objects). Therefore every Java serializable to be passed between a client and server (for example, by a CORBA client as a parameter or return value for an Enterprise JavaBean) must be re-implemented in the language of the client. (The implementation for the valuetype must be defined and provided in the language runtime for both the client and the server.) Implementation of Java serializables as valuetypes in C++ or another language can be a significant development effort.

Valuetypes were introduced by the CORBA 2.3 specification and many 3rd-party ORBs do not yet implement the specification, or do not implement it fully.

To aid application development, WebSphere Application Server provides a valuetype library that contains the C++ valuetype implementation for some commonly used Java classes in the java.lang, java.io, and java.util packages. For example, Integer, Float, Vector, Exception, OutputStream, and so on. For more information about the valuetype library provided with WebSphere Application Server, see WebSphere CORBA valuetype library for C++.

Java language to IDL specification

An Enterprise JavaBean is implemented in Java, with no hint of the CORBA architecture in its programming model. The Enterprise JavaBean specification requires that the server implementation be restricted to using those Java language constructs defined as the RMI/IDL subset by the Java language to IDL specification.

By following the Java language to IDL specification, you can create CORBA clients implemented in any programming language for which there is a defined mapping, and for which an ORB supporting valuetypes is available.

When valuetypes are not supported

For languages other than Java, such as C++, the CORBA architecture is often the only viable option for accessing Enterprise JavaBeans.

For session bean interfaces that only use primitive data types, you can use generated IDL files to access the Enterprise JavaBeans even if the client ORB does not support valuetypes. However, the IDL generated from such an Enterprise JavaBean can still include valuetype declarations for exceptions or other entities.

For valuetypes, java.lang.String or any other serializable cannot be used in a parameter or return type. There can also be problems catching exceptions, because they contain valuetypes.

If you decide that the features supported by valuetypes are not needed, consider using the strategies outlined in Unsupported CORBA data types.