Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-15-2003
ChMeessen ChMeessen is offline
Registered User
 
 
Join Date: Sep 2003
Location: Marseille
Posts: 11
Question Objects as argument ?

Hello,

from the documentation I see that objects can be passed as argument.
Since the client was generated using the Slice definition this should work. But what if the servant has referenced a derived class the client does not know about ?

What is sent to the client ? What does it instantiate ? Does it throw an exception ?


It would be ok if only structures without methods would be passed along. If the servant had a derived class it would only copy the struct corresponding to the argument type.


Passing objects is a nice and desirable feature but I think it is also problematic since we can't send methods.
Reply With Quote
  #2 (permalink)  
Old 09-15-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
For classes with operations, you must install an object factory. Have a look at demo/Ice/value for an example.
Reply With Quote
  #3 (permalink)  
Old 09-18-2003
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
Re: Objects as argument ?

Quote:
Originally posted by ChMeessen
Hello,

from the documentation I see that objects can be passed as argument.
Since the client was generated using the Slice definition this should work. But what if the servant has referenced a derived class the client does not know about ?

What is sent to the client ? What does it instantiate ? Does it throw an exception ?
If a class has operations, it is abstract and you need to install a factory for the concrete type of the class (or, at least, a factory for one of the base types of the class). If a class has only data members and no operations, the class is concrete and does not require a factory.

If the sender sends a class instance that is more derived than the formal type and the receiver does not have static knowledge of the actual run-time type of the instance, the instance is sliced to the most derived type that the receiver understands. The value demo in the Ice distribution illustrates this.

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
No sequences of objects in Ice-E? bartley Help Center 5 05-30-2006 06:44 PM
How can I get all Objects in evictor db? Yunqiao Yin Help Center 2 02-10-2006 04:21 AM
createObjectAdapterWithEndpoints: purpose of 'name' argument PeteH Help Center 1 12-14-2005 05:09 PM
Objects and Proxies ganzuoni Help Center 1 06-18-2003 03:49 PM


All times are GMT -4. The time now is 08:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.