Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 01-28-2005
ChMeessen ChMeessen is offline
Registered User
 
 
Join Date: Sep 2003
Location: Marseille
Posts: 11
Q on Data encoding

Hello,

I am studying the data encoding convention used in ICE and I had a few questions related to reference encoding.

1° Why using negative numbers for pointers and not same value as class id n° ? Context of use leaves no ambiguity between pointer and class id. Is this a scar of ICE data encoding evolution ?

2° The classID is an arbitrary number picked by the marshaller. This gives indeed some liberty degree, except that the value must be a strictly positive number. As shown in one example (in table 40.4 of ICE doc 2.0) and explained in the algorithm presented at page 1108, the natural strategy would be to number classes from 1 to N in the order of their serialization. This numbering rule seams perfectly deterministic. So why not making this numbering rule standard and let classID be implicitely numbered by order or serialization ? This would allow to get rid of this number in the serialized data.


3° Why choosing the "delayed object serialization" and not a serialization in place of first reference ? Is it to avoid stack overflow when marshalling very deep data structures ? Shouldn't this rationale then also apply to sequences ?


4° I am a bit confused about sequences. It looks like sequences are not treated like referenced data. What happens if two arguments of a method call are in fact referencing the same array ?From the documentation fragments I red it looks like ICE marshalling process would generate two distinct copies of the sequence. So the receiver doesn't know that these are in fact the same array. I know that we can get around this, if this happens to be a problem, by encapsulating the array in an object. But CORBA handles sequences as referenced data so it would handle shared sequences properly. What about ICE ?

Last edited by ChMeessen : 01-28-2005 at 09:46 AM.
Reply With Quote
  #2 (permalink)  
Old 01-28-2005
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
Questions 1-3 refer to objects by value, correct? If so, then I leave this to Michi to answer, since he wrote the object by value marshaling code. (It might take awhile until he responds, because he is currently on vacation.)

With respect to question 4, sequences are not shared, neither in Ice nor in CORBA. They do not have reference semantics. For example, in C++ a sequence of strings maps to std::vector<std::string>. If you want a sequence by reference, then you must use a class with a sequence data member. Ice is not different from CORBA in this respect.
Reply With Quote
  #3 (permalink)  
Old 01-28-2005
ChMeessen ChMeessen is offline
Registered User
 
 
Join Date: Sep 2003
Location: Marseille
Posts: 11
Do you mean Michi designed the class serialization encoding ?

Thank you for the clarification on sequence semantic. I should add oops... !

I should better read the Slice language specification before asking anymore questions

Last edited by ChMeessen : 01-28-2005 at 10:34 AM.
Reply With Quote
  #4 (permalink)  
Old 01-28-2005
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
Yes, Michi designed the object-by-value serialization. I wrote the initial version, but it didn't support slicing. Michi then later redesigned the marshaling, so that slicing is now fully supported. He also added an object-by-value garbage collector for Ice for C++. Without this garbage collector, you get a memory leak in C++ if you receive objects that reference each other, i.e., if there are cyclic references.
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
ICE client encoding GBK error tangxiaoshu Help Center 9 12-25-2006 03:17 AM
Encoding Problem about Chinese, client compiled by Java, server compiled by C++ richardma Help Center 6 12-21-2005 12:00 AM
encoding error when Ice java client get string from Ice c++ server casper Help Center 1 09-16-2005 04:01 AM
IceSSL encoding nsns Bug Reports 4 01-26-2005 05:03 AM
IcePack.Registry.Data and IcePack.Node.Data directories vsonnathi Comments 0 10-21-2004 06:12 PM


All times are GMT -4. The time now is 07:55 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.