Hello folks, i will try to be brief:
I have one object MyObject which i use as parameter to my beans's method, like:
public class MyBeanEJB extends SessionBean {
public void doSomething( MyObject obj_ )
{
//something here
}
}
And
public class MyObject
{
//Some code:
}
My problem is, every object that i use as parameter and or result from a method must implement Serializable?
Regards,
Edson
-
Doubt about object parameters and EJB (3 messages)
- Posted by: Edson Alves Pereira
- Posted on: June 11 2005 16:24 EDT
Threaded Messages (3)
- Doubt about object parameters and EJB by Viktor Sadovnikov on June 12 2005 17:33 EDT
- pass by value/pass by reference by Biswa Das on June 13 2005 17:56 EDT
- Network Object ==> Serialized Object by Damiano Altomare on June 14 2005 03:50 EDT
-
Doubt about object parameters and EJB[ Go to top ]
- Posted by: Viktor Sadovnikov
- Posted on: June 12 2005 17:33 EDT
- in response to Edson Alves Pereira
My problem is, every object that i use as parameter and or result from a method must implement Serializable?
Yes, they do. Unless it's a local session bean.
That's the reason why paramaters should be of a light classes. Please also take into account that if you parameter include reference to another object, the referenced object will be also serialized.
Please, have a look at Transfer Object pattern: http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html -
pass by value/pass by reference[ Go to top ]
- Posted by: Biswa Das
- Posted on: June 13 2005 17:56 EDT
- in response to Edson Alves Pereira
In remote call everything is passs by value so the object must be marshalled and unmarshalled. -
Network Object ==> Serialized Object[ Go to top ]
- Posted by: Damiano Altomare
- Posted on: June 14 2005 03:50 EDT
- in response to Edson Alves Pereira
Objects sent on the network must be serialized (i.e. must implement Serializable interface).