|
|
|
|||||
|
Documentation Clarification, Perhaps
Hi,
Here are a couple of suggestions that I think would make it easier for new users to understand ICE. 1) Document all the useful classes in a "class reference". Some of this is already in "Slice Documentation", but it would be great if non-slice classes (and language-specific issues) had similar documentation. The chapter title also isn't what a newcomer would normally look for. 2) The slice documentation (chapter 4) talks about classes being passed by value (class types) and reference (proxy types). To me, this is very misleading -- especially in C++, since classes are implemented as smart pointers, which are in essence, references to objects. The C++ documentation doesn't do a great job about explaining this mechanism either. I think that when discussed in these forums, it has been made clear that structs are "value types" and classes are "reference types", but this doesn't mesh with the way things are described in 4.11.5 and 4.11.11. If there is a good discussion of the generated Ptr types, I haven't seen it. I'd be happy to write something if that would be helpful. Cheers,
__________________
-- Andrew Bell National Resources Inventory Center for Survey Statistics & Methodology Iowa State University andrew.bell.ia@gmail.com |
|
|||||
|
Class Ptr Types from slice
Hi,
Thanks for the explanation. I think that there are two disconnects here. 1) I can't find anywhere in the documentation where it says that a class type in an operation will map to a class Ptr type in C++. This has taken several of my people a while to get square with: slice: class foo { int a; }; foo op(foo) -> slice2cpp -> fooPtr op(fooPtr, Ice::Current) [ for server ] The documentation says "Slice classes are mapped to C++ classes with the same name." This is true, but NOT true when their context is an operation. In such cases, slice classes are mapped to references (Ptrs) to C++ classes of the same name. 2) When you use the term reference, you are thinking in terms of an ICE object. When my people are using the term reference with regard to C++ code, they are thinking of passing things by reference in C++ or as an indirection to an object that exists IN THEIR ADDRESS SPACE, not over the wire. Its just the terminology that gets confusing. When you get a fooPtr, you have a REFERENCE to a foo object that exists in the local address space. When you say that classes are passed by value, you mean that a copy of the class object is sent across the wire, but in the C++ mapping, when someone get a class object (as defined in slice), they get a reference to the object (a fooPtr) that exists in the local address space. I have had repeated conversations with people that work with me on this. It keeps coming up. This is why I think some terminology clarification in the documentation with regard to the class slice -> C++ mapping for operations would be helpful. Thanks,
__________________
-- Andrew Bell National Resources Inventory Center for Survey Statistics & Methodology Iowa State University andrew.bell.ia@gmail.com |
|
||||||
|
In general, we try to avoid the term "reference", since it has way too many meanings. Instead, we use the following:
|
![]() |
| 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 |
| Bidirectional Socket Clarification | gsalazar | Help Center | 19 | 01-17-2008 07:24 AM |
| .NET 2.0 support clarification | ttouris | Help Center | 4 | 02-10-2006 02:10 AM |
| Documentation | ChrisC | Comments | 7 | 09-16-2005 10:31 AM |
| Ice documentation | catalin | Help Center | 5 | 04-04-2004 06:13 PM |
| FreezeMap Use Clarification | Ken Carpenter | Comments | 11 | 03-01-2003 06:42 AM |