Topic: 我想问问关于序列化,多谢大家

  Print this page

1.我想问问关于序列化,多谢大家 Copy to clipboard
Posted by: magician
Posted on: 2003-08-15 14:34

如果我没有使用任何需要序列化的操作

而对象本身实现了序列化的接口

那么在普通方法的调用、参数传递过程中,性能会受到影响吗?

比如Order这个类implement Serializable

现在有两个方法:

Order getOrder(int orderID)
void createOrder(Order order)

在调用这两个方法的时候,order实现序列化,和没有实现序列化,性能上有什么不同吗?

多谢各位解答了!

2.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: menzy
Posted on: 2003-08-15 14:44

看一下java 规范,除了该类的存储空间会有所损失以外,不会影响普通操作

3.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: magician
Posted on: 2003-08-15 14:47

是指内存的存储空间?

如果是,那么调用过程应该会受影响啊?

我查过API,规范还没看.............

4.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: jameszhang
Posted on: 2003-08-15 17:12

会有不同,这正是ejb2.0中出现LOCAL 和REMOTE两种接口的原因之一,不知我的理解对否?

5.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: lixj0571
Posted on: 2003-08-20 17:34

这正是ejb2.0中出现LOCAL 和REMOTE两种接口的原因之一,不知我的理解对否?
这是为在session Bean 调用entity bean .再有是在一个jvm

6.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: zyzhang
Posted on: 2003-08-20 20:57

This can make difference when you do remote method calls or store/restore Order Object from file. This is why serialiazable interface(it's just a tag) is introduced.

7.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: hut
Posted on: 2003-09-08 18:30

在同一个JVM中没有多大区别,但是在不同的JVM中,参数传递是按值传递的

8.Re:我想问问关于序列化,多谢大家 [Re: magician] Copy to clipboard
Posted by: ftang
Posted on: 2003-09-08 21:56

"hut" is right, nothing about REMOTE and LOCAL, just because in one JVM, object pass by reference, but in different JVM, pass by Value. one thing I notice is: some app server, the web container and ejb container is two JVM, so watch out...

"menzy" said check the java api, I read this from jdk1.2 spec, that was long long time ago, but I still think u can find this, in J2SE spec not j2EE.

Local interface is used by in one JVM. but currently all the Enterprise enviroment who will only have one JVM? I called IBM, they don't suggest ONLY use LOCAL Call, too dangerous, if the ejb container is failed, u should try to talk any ejb container in ur enviroment

9.Re:我想问问关于序列化,多谢大家 [Re: ftang] Copy to clipboard
Posted by: jameszhang
Posted on: 2003-09-09 09:12

ftang wrote:
"hut" is right, nothing about REMOTE and LOCAL, just because in one JVM, object pass by reference, but in different JVM, pass by Value. one thing I notice is: some app server, the web container and ejb container is two JVM, so watch out...

"menzy" said check the java api, I read this from jdk1.2 spec, that was long long time ago, but I still think u can find this, in J2SE spec not j2EE.

Local interface is used by in one JVM. but currently all the Enterprise enviroment who will only have one JVM? I called IBM, they don't suggest ONLY use LOCAL Call, too dangerous, if the ejb container is failed, u should try to talk any ejb container in ur enviroment

您的意思是在一个JVM中用REMOTE and LOCAL的性能是一样的吗?
您的“ONLY use LOCAL Call” 好象在一个项目中不太可能,如果不考虑扩展我认为可以不用EJB


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923