These days, we've happened to fullfill a task that convert complex entity objects to byte arrays. Naturally, the interface serializable has come into my brain at once.
However, the performance became a main issue - it's too slow. An [url=http://www.javalobby.org/forums/thread.jspa?messageID=92059245]article[/url] came to an help, which suggests a substitution, Externalizable, for Serializable. By which the performance was twice as efficient as the original design.
But this still not meet the requirement. The final way is to utilize an anti-object-oriented programming pattern - just use byte array to store data.
However, the performance became a main issue - it's too slow. An [url=http://www.javalobby.org/forums/thread.jspa?messageID=92059245]article[/url] came to an help, which suggests a substitution, Externalizable, for Serializable. By which the performance was twice as efficient as the original design.
But this still not meet the requirement. The final way is to utilize an anti-object-oriented programming pattern - just use byte array to store data.
本文探讨了在Java中提高复杂实体对象转为字节数组的序列化效率问题。作者最初考虑使用Serializable接口,但发现其性能不佳。通过研究,找到了Externalizable作为替代方案,使性能提升了两倍。然而,这仍然不够,最终采取了反面向对象的方法,直接用字节数组存储数据。
94

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



