见到的关于 Serialization and Marshalling 的最好的解释:
Both do one thing in common - that is serializing an Object. Serialization is used to transfer objects or to store them. But:
- Serialization: When you serialize an object, only the member data within that object is written to the byte stream; not the code that actually implements the object.
- Marshalling: Term Marshalling is used when we talk about passing Object to remote objects(RMI). In Marshalling Object is serialized(member data is serialzied) + Codebase is attached.
So Serialization is part of Marshalling.
CodeBase is information that tells the receiver of Object where the implementation of this object can be found. Any program that thinks it might ever pass an object to another program that may not have seen it before must set the codebase, so that the receiver can know where to download the code from, if it doesn’t have the code available locally. The receiver will, upon deserializing the object, fetch the codebase from it and load the code from that location.
本文详细解释了序列化(serialization)与打包(marshalling)的区别。序列化主要用于对象的转移或存储,仅写入对象成员数据而不包含实现代码;而打包不仅包括序列化过程,还附加了代码库信息,以便远程对象可以获取到对象实现的代码。
2632

被折叠的 条评论
为什么被折叠?



