VA 4.5 IIOP and nil objects 
Author Message
 VA 4.5 IIOP and nil objects

Hello,

I have an existing application which I want to IDL-ize it, so it can
be used as a server. But the application sometimes return nil objects.
On the client side I get a CORBA exception COMM_FAILURE, which can be
everything. Is there a better solution to handle these nil objects?
Thanks for your help in advance.

Ho



Wed, 18 Jun 1902 08:00:00 GMT  
 VA 4.5 IIOP and nil objects

Quote:

>Hello,

>I have an existing application which I want to IDL-ize it, so it can
>be used as a server. But the application sometimes return nil objects.
>On the client side I get a CORBA exception COMM_FAILURE, which can be
>everything. Is there a better solution to handle these nil objects?
>Thanks for your help in advance.

I do not have experience with VA, just with general CORBA Smalltalk mapping,
but maybe even that can be of some help to you. In standard mapping you have
to supply object of correct type. Specifically nil can never be passed as a
CORBA parameter or return value. In our app we usualy write small adapters
that ensure that IDL interface is respected.

Davorin Rusevljan



Wed, 18 Jun 1902 08:00:00 GMT  
 VA 4.5 IIOP and nil objects

Quote:

>Hello,

>I have an existing application which I want to IDL-ize it, so it can
>be used as a server. But the application sometimes return nil objects.
>On the client side I get a CORBA exception COMM_FAILURE, which can be
>everything. Is there a better solution to handle these nil objects?
>Thanks for your help in advance.

I do not have experience with VA, just with general CORBA smalltalk mapping,
but maybe even that can be of some help to you. In standard mapping you have
to supply object of correct type. Specifically nil can never be passed as a
CORBA parameter or return value. In our app we usualy write small adapters
that ensure that IDL interface is respected.

Davorin Rusevljan



Wed, 18 Jun 1902 08:00:00 GMT  
 VA 4.5 IIOP and nil objects

Quote:

>Hello,

>I have an existing application which I want to IDL-ize it, so it can
>be used as a server. But the application sometimes return nil objects.
>On the client side I get a CORBA exception COMM_FAILURE, which can be
>everything. Is there a better solution to handle these nil objects?
>Thanks for your help in advance.

>Ho

As your other respondent mentioned, nil cannot be passed as a valid
IDL type.  There is no default mapping between a Smalltalk nil object
and an IDL type.  You could create an IDL type that represents nil but
then you have the problem that operations (methods) must return a
typed result.  To get around this you could do one of two things:
specify the return type to be an 'any' which is a valid IDL type that
matches any type; or specify the return type to be a union of the type
it usually returns and your mapping for nil.

The drawback of 'any' types is that they must be self describing
therefore they take up more space in the request that is sent over the
network and they take longer to marshall and unmarshall.

Unions would also take more space but not as much as an 'any'.

The best solution, IMHO, is to get rid of the nil return values from
methods.  I believe that they do not reflect good OO design anyway.
This design is in general not portable to typed OO languages.  I'd be
curious as to why these methods are returning nil since I've been in
the position of making this recommendation to others in the past and
would like to have a better handle on what their reasons for doing
this are.

Good luck,

Larry



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VA 4.5 IIOP Examples

2. IIOP support in VA Smalltalk 4.5

3. VAST 4.5 SST IIOP Examples

4. Basic help needed using IIOP in VAST 4.5

5. Conversion stories from VA 3.0a to VA 4.5

6. VA 4.5 Web Connect Feature problem

7. VA 4.5 >> Container Details Tree

8. api-calls in VA 4.5

9. api-calls in VA 4.5.

10. Printing in VA 4.5 (WinNT)

11. Is OLE Supported in VA 4.5 Smalltalk Server

12. DCSTUG meeting 8/28 - IBM VA 4.5

 

 
Powered by phpBB® Forum Software