Home : J-Integra for .NET : INFO : Differences Between Pass by Value and Pass by Reference
Q140161 - INFO: Differences Between Pass by Value and Pass by Reference

Differences Between Pass by Value and Pass by Reference

 

J-Integra for .NET supports passing classes by two different ways: Pass By Value and Pass By Reference.

If a class is a "Pass By Reference" type, then only the methods will appear on the .NET side. "Pass By Reference" only provides access to the methods, not the fields.

If a class is a "Pass By Value" type, then only the fields (and get/set methods for those) will appear on the .NET side.

While using J-Integra for .NET tools creating proxies, by default all classes are "Pass By Reference". Any class which implements java.io.Serializable can be passed as "Passed by Value". Infact, the runtime assumes that all classes implementing the interface java.io.Serializable are "Pass By Value" objects unless specified otherwise in Janetor.

GenNET tool is used to create "Pass By Value" proxies of the java classes. Once you have added the class, highlight and then click the "Options". You should see a checkbox to select for "Pass by Value". The options dialog is only enabled on classes that implement the java.io.Serializable interface. When we generated the proxy we selected "Pass By Value" which means that we want this class to be serialized and passed entirely across the wire. When J-Integra generates the proxies it creates getters for the class fields. The classfields are named : A, D, E , F, etc. This is because this class is part of an API that has been obfuscated.

Then if you get the Serialization error in GenNET tool: "The type full.class.name Version=1.231231, Culture=netural, PublicKeyToken=null is not marked as serializable". The reason you receive this error is because the J-Integra for .NET runtime encounters this class and it implements the java.io.Serializable interface so it tries to "Pass it By Value" when on the .Net side it is expecting a "Pass By Reference" class. For more detailed explaination, please see SerializationException when Calling Java Methods

Related Articles
Q55264 - ERRMSG: SerializationException when Calling Java Methods that Return a Java Object

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 6/23/2006.
Last Modified on 7/10/2006.
Last Modified by No Author Name Available!.
Article has been viewed 8284 times.
Rated 6 out of 10 based on 2 votes.
Print Article
Email Article