From an external user:
] To: "'###@###.###'" <###@###.###>,
] "'###@###.###'" <###@###.###>,
] "'###@###.###'" <###@###.###>
] Subject: Description of local method calls
]
] Admittedly, I am splitting hairs here, but I am bothered by the way the EJB
] 2.0 (section 5.3) and RMI specifications (section 2.3) contrast argument
] passing in remote and local method calls. They both imply that local method
] calls pass arguments "by reference", whereas I believe it is technically "by
] value". Now, I can't find a description of argument passing in the Java
] Language Specification, but every book I've read and even the Java Tutorial
] (http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html, see
] excerpt below ) describes argument passing in local calls as being "by
] value" - specifically, the value of the reference (or primitive) passed as
] an argument.
]
] I am assuming the "pass by value" and "pass by copy" are both similar and in
] contrast to "pass by reference". If that is the case, these specifications
] would seem to be incorrect in saying local calls are "pass by reference" and
] remote calls are "pass by value (or copy)". If that is not the case, please
] explain. I realize that there IS a difference in the way arguments are
] passed in remote calls. I just think Sun should find a way to describe it
] that doesn't contradict how it has described local calls in other
] documentation. Do you see my point?
Yes, the RMI spec should be more clear that it is referring specifically to object passing, which is a subtly different and higher-level view from the mechanics of the language, in which arguments are indeed always passed by value in local method invocations. This conflicting use of terminology is confusing without such a clarification. (See Comments for more discussion.)
] To: "'###@###.###'" <###@###.###>,
] "'###@###.###'" <###@###.###>,
] "'###@###.###'" <###@###.###>
] Subject: Description of local method calls
]
] Admittedly, I am splitting hairs here, but I am bothered by the way the EJB
] 2.0 (section 5.3) and RMI specifications (section 2.3) contrast argument
] passing in remote and local method calls. They both imply that local method
] calls pass arguments "by reference", whereas I believe it is technically "by
] value". Now, I can't find a description of argument passing in the Java
] Language Specification, but every book I've read and even the Java Tutorial
] (http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html, see
] excerpt below ) describes argument passing in local calls as being "by
] value" - specifically, the value of the reference (or primitive) passed as
] an argument.
]
] I am assuming the "pass by value" and "pass by copy" are both similar and in
] contrast to "pass by reference". If that is the case, these specifications
] would seem to be incorrect in saying local calls are "pass by reference" and
] remote calls are "pass by value (or copy)". If that is not the case, please
] explain. I realize that there IS a difference in the way arguments are
] passed in remote calls. I just think Sun should find a way to describe it
] that doesn't contradict how it has described local calls in other
] documentation. Do you see my point?
Yes, the RMI spec should be more clear that it is referring specifically to object passing, which is a subtly different and higher-level view from the mechanics of the language, in which arguments are indeed always passed by value in local method invocations. This conflicting use of terminology is confusing without such a clarification. (See Comments for more discussion.)