.NET中的序列化过程 [英] Serialization process in .net

查看:69
本文介绍了.NET中的序列化过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在google serializatio上都说这是将对象转换为其位表示的过程.但是我的问题是对象以位表示形式存在于内存中,那么为什么要在远程事务处理时要求单独的序列化处理? "

I google serializatio-it all says it is an process of converting object into its bits representation.but my question is that "objects are resides in memory in form of bit reprentation then why requird the separate process of serialization while remote transfes?"

推荐答案

几乎从来没有一个单独的过程.序列化发生在您将其放入的过程中,这几乎总是与您使用内存中数据的过程相同.

而且,从某种意义上说,情况总是如此.我会解释原因.假设您创建了一个单独的过程来对文件/网络中的某些数据模型进行序列化/反序列化.然后您会发现进程是完全隔离的,并在单独的隔离内存空间中执行.在这种情况下,您会怎么做?您将需要在这两个过程之间进行通信,即使用某些 IPC ( http://en .wikipedia.org/wiki/Inter-process_communication [^ ]).那可能是什么? 非常序列化!

你有主意吗?在单独的过程中进行序列化将毫无意义.

—SA
It''s almost never a separate process. Serialization takes place in the process you put it in, and this is almost always the same process where you use the data in memory.

Moreover, in some sense, this is always the case. I''ll explain why. Suppose you created a separate process to serialize/deserialize some data model to/from file/network... When you need to use it in some other process; and then you will find that the processes are well isolated and are executed in separate isolated memory spaces. What will you do in this case? You will need to communicate between these two processes, that is use some IPC (http://en.wikipedia.org/wiki/Inter-process_communication[^]). And what it could be? Same very serialization!

Are you getting the idea? Serialization in a separate process would make little to no sense.

—SA


这篇关于.NET中的序列化过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆