|
|
|
|||||
|
slice2java
i'm not sure if it's a bug and not a feature.
slice2java generates code with wrong class names in case of using external ice-modules and using --package option. I need that option to explictly specify package name as I want to have the following directory/class hierarhy: test/ server/ client/ common/ where package test.server consists of server implementation, test.client - client implementation and test.common - slice2java generated stuff shared by both client and server. i know that if i use "module test.common" in test.ice i get what i want but i think it's a wrong way to mix declaration and implementation things. $ slice2java --package test.common test.ice ------------------ test.ice ------------------ #include <Ice/BuiltinSequences.ice> interface Test { void testByteSeq(Ice::ByteSeq seq); }; ------------------ test/common/_TestDisp.java ------------------ ... public static IceInternal.DispatchStatus ___testByteSeq(Test __obj, IceInternal.Incoming __in, Ice.Current __current) ... byte[] seq; seq = test.common.Ice.ByteSeqHelper.read(__is); ... ------------------ test/common/_TestDelM.java ------------------ ... public void testByteSeq(byte[] seq, java.util.Map __context) ... test.common.Ice.ByteSeqHelper.write(__os, seq); ... ------------------ Notice wrong type in both files test.common.Ice.ByteSeqHelper instead of Ice.ByteSeqHelper |
|
|||||
|
I see the problem with module - package mapping. And I can not see any rational way to fix it while it is possible to override package name at the time of generating code so there is no information about package names in ice sources.
IMHO, one solution is to: 1) remove comman line option to redefine package name (optional, could be kept for compatibility) 2) add somthing like the following to the ice syntax: ["java:<package_name>"] module <module_name> { } Thanks for your work Alexander |
|
||||||
|
Hi,
Yes, the best solution is to have the package information in the Slice file. We considered using the existing metadata facility for specifying the package. The problem, however, is that you would have to repeat the metadata for every top-level definition in the file, and it introduces some perplexing issues. We solved it a slightly different way. In the next release, Slice will support "global" metadata, which is metadata that can only appear once in a file, must appear before any definitions, is not affected by and has no effect on included files, and applies to all of the definitions in the file. For example: Code:
[["java:package:com.zeroc"]]
module M {
// ...
};
- Mark |
|
|||||
|
Hmm... Does "global" mean that all top level definitions in the ice file share package name from such metadata? What about following collision:
module m1 { interface I {}; }; module m2 { interface I {}; }; However, it makes sense if such metadata used as "prefix" so the following ice definition [["java:package:test"]] module m1 { interface I { ... }; }; module m2 { interface I { ... }; }; produces test.m1.I and test.m2.I without any namespace confilicts |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| slice2java | ChenQingQing | Help Center | 4 | 09-25-2006 03:20 AM |
| Where is slice2java | dashie | Help Center | 7 | 09-04-2006 06:21 AM |
| run slice2java for WinXP | torrecam | Help Center | 1 | 02-21-2005 10:33 AM |
| slice2java command | anitha | Help Center | 3 | 10-14-2004 09:35 PM |
| Patch for slice2java, v1.5.1 | michi | Patches | 0 | 08-19-2004 05:53 PM |