Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-18-2006
rc_hz rc_hz is offline
Registered User
 
Name: Eric RC
Organization: www.genband.com
Project: No project yet
 
Join Date: Jul 2004
Location: Hangzhou, China
Posts: 189
Send a message via MSN to rc_hz
-->
Is this a cross-platform/language problem ?

If a server-side programmer uses java5 platform and he write a slice file which uses some java5 features such as generic, special collection:
Code:
#ifndef SIMPLETEST_ICE
#define SIMPLETEST_ICE

module Simpletest
{
    ["java:type:java.util.LinkedList<String>:java.util.List<String>"]
    sequence<string> StringList;
};                
#endif
Of course, the server-side programmer has no problem to use this slice file in java5 platform. Then he distributes this slice file to client-side programmer.


However, the client-side programmer uses java2 platform instead of java5 platform, so he uses the following command to generate code:
Code:
slice2java --output-dir generated Simpletest.ice
This generates two files: StringListHolder.java, StringListHelper.java. More details of StringListHolder.java is as follows:
Code:
//...
public final class StringListHolder
{
    public
    StringListHolder()
    {
    }

    public
    StringListHolder(java.util.List<String> value)
    {
	this.value = value;
    }

    public java.util.List<String> value;
}
//...
These two files can not be compiled in java2 platform. So is it a problem of cross-platform/language ? Maybe slice2java should be smarter so that it can generate different code in java2 platform. To do so, there is a need for the client-side programmer to pass some cue to slice2java.
__________________
Eric RC
www.genband.com (telecommunication)
I like ICE (Ice for C++/Java/Python)
Reply With Quote
  #2 (permalink)  
Old 08-18-2006
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
What goes on the wire in both cases is identical -- so there is no cross-platform/cross-language problem. What you are running into is using specific language meta-data changes the compiled definitions of the slice definitions. To solve this problem you can either use two sets of slice definitions with different pieces of meta-data, or you can use #ifdef to do this. Something like:

Code:
module Simpletest
{
#ifdef JAVA5
    ["java:type:java.util.LinkedList<String>:java.util.List<String>"]
#endif
    sequence<string> StringList;
};
Reply With Quote
  #3 (permalink)  
Old 08-18-2006
rc_hz rc_hz is offline
Registered User
 
Name: Eric RC
Organization: www.genband.com
Project: No project yet
 
Join Date: Jul 2004
Location: Hangzhou, China
Posts: 189
Send a message via MSN to rc_hz
-->
Quote:
To solve this problem you can either use two sets of slice definitions with different pieces of meta-data, or you can use #ifdef to do this.
Yes, these are two solutions, but I think they are not the best! It's better if slice2java can solve this.
__________________
Eric RC
www.genband.com (telecommunication)
I like ICE (Ice for C++/Java/Python)
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
Which language mapping(s) do you use? marc Comments 12 05-31-2006 07:19 AM
Problems with 3.0.1 cross-platform IceGrid brian Help Center 0 02-17-2006 03:04 PM
ICE Features Across Language Mappings Bytenik Comments 1 04-04-2005 04:55 PM
Cross development ahartveld Help Center 0 01-08-2004 12:44 PM
force use of specific Slice libs (cross compiling) rbx Help Center 1 12-09-2003 03:14 PM


All times are GMT -4. The time now is 04:55 AM.


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.