serialization

Object serialization practical uses?

How many software projects have you worked on used object serialization? I personally never came across a scenario where object serialization was used. One use case i can think of is, a server software storing objects to disk to save memory. Are there other types of software where object serialization is essential or preferred over a dat...

Saving object state on Java without using external memory

Good day. I know that in order to save object state in Java I should use serialization. But in every single topic about serialization states that I must save my object somewhere (disk, network). My problem is that I'm not allowed to do so. I need a way to save and recover object state without writing it on "external" memory. Maybe to sav...

Deserialize Xml with empty elements in C#

Trying to deserialize some xml snippits from a vendor into objects. The problem is that I'm getting an invalid format on every empy element tag. I can deserialize the object no problem when all of the elements have values. Or the empty elements are ommitted. Xml Snippit: <foo><propOne>1</propOne><propTwo /></foo> C# Class: ...

Boost::Serialization Mpi Sending array of user defined types

I want to send my Array class using boost Mpi template<class T> class Array { private: int size; T* data; public: // constructors + other stuff }; Here T can be any built in type or user defined type. Suppose I have a class complex struct complex { std::vector<double> real_imag; // contain two elements }; So the question i...

protobuf-net NOT faster than binary serialization?

I wrote a program to serialize a 'Person' class using XMLSerializer, BinaryFormatter and ProtoBuf. I thought protobuf-net should be faster than the other two. Protobuf serialization was faster than XMLSerialization but much slower than the binary serialization. Is my understanding incorrect? Please make me understand this. Thank you for ...

Is there a Tool for see files created with binary serialization?

I've working without problems serializating object graphs to and from files. Everything was fine until today: A dictionary, created in a constructor and NEVER deleted, was lost (null referece) just after deserialization from file, for the first time in more than a year doing the same without troubles. So, is there a Software Tool to loo...

How to share an array in Python with a C++ Program?

I two programs running, one in Python and one in C++, and I need to share a two-dimensional array (just of decimal numbers) between them. I am currently looking into serialization, but pickle is python-specific, unfortunately. What is the best way to do this? Thanks Edit: It is likely that the array will only have 50 elements or so, bu...

final transient fields and serialization

Is it possible to have final transient fields that are set to any non-default value after serialization in Java? My usecase is a cache variable — that's why it is transient. I also have a habit of making Map fields that won't be changed (i.e. contents of the map is changed, but object itself remains the same) final. However, these att...

Unserialize in ActionScript 3

I have an array that I am constructing in PHP which I am serializing then returning to Flex through AMFPHP. Can someone point me towards a solution for unserilizing said data once it gets into Flex via ActionScript 3? ...

How-to Serialize/Unserialize a SimpleXML Object?

I've seen a few creative solutions for dealing with serialized SPL objects but am looking for more options (or elaborations). I store nested serialized objects - of which, one is SimpleXML - in the database, only to be un-serialized later. This obviously cause some problems. $s = new SimpleXmlElement('<foo>bar</foo>'); $ss = serialize($...

How to avoid GeneratedSerializationConstructorAccessor problems?

We have a Java App that receives SOAP requests, and after a lot of requests we notice that the GC stops the world to unload a lot of GeneratedSerializationConstructorAccessor classes. This is a big performance impact. Does anyone know how to avoid this or at least significantly reduce the count of GeneratedSerializationConstructorAccess...

Object graph serialization in .NET and code version upgrades

I need to serialize some object graphs to disc What difficulties am I likely to encounter if I make changes to a class, then try to deserialize an old version? Do some serializers handle this better than others? What is the standard way of handling such a scenario? For example, in a new version of the code, do I need to retain all th...

What's a good machine-readable formal way of describing telecom protocols such as SMPP or CIMD2?

I've implemented several telecom protocols from human-readable specs in various languages during my career, and frankly, I'm not enjoying it very much anymore. Instead, I'd like to translate the human-readable protocol specs into machine-readable protocol specs, and automatically generate protocol handlers in various languages. I'm sp...

How to change the behavior of string objects in web service calls via Windows Communication Foundation?

I have third party api's which require string values to be submitted as empty strings. On an asp.net page I can use this code (abbreviated here) and it works fine: public class Customer { private string addr1 = ""; public string Addr1 { get {return addr1;} set {addr1 = value;} } private string addr2 ...

Serializing Exceptions WCF + Silverlight

I have a WCF service I use to submit bugs for my project. Snippet of the data class: Private _exception As Exception <DataMember()> _ Public Property Exception As Exception Get Return _exception End Get Set(ByVal value As Exception) _exception = value End Set End Property I have a Silverlight app that ...

Why is Serializable Attribute required for an object to be serialized

Based on my understanding SerializableAttribute provides no compile time checks, as its all done at runtime, then why is it required for classes to be marked as serializable? Couldn't sterilizer just try to serialize an object and just fail? isn't it what it does right-now when something is marked, it tries and fails. wouldn't it be bet...

Delphi (win32) serialization libraries

Are there any Delphi serialization libraries that are capable of serializing records and arrays of records instead of classes? ...

what is serialization and how it works

Possible Duplicate: Why Java needs Serializable interface? I know the serialization process but have't implemented it. In my application i have seen there are various classes that has been implemented serilizable interface. consider following class public class DBAccessRequest implements Serializable { private ActiveReq...

How to save big "database-like" class in python

Hi there, I'm doing a project with reasonalby big DataBase. It's not a probper DB file, but a class with format as follows: DataBase.Nodes.Data=[[] for i in range(1,1000)] f.e. this DataBase is all together something like few thousands rows. Fisrt question - is the way I'm doing efficient, or is it better to use SQL, or any other "prope...

cPickle class with data save to file

Hi there, I've big class in Python it's "DataBase-like" class. I want to save it to file - all including data. This is input(example to show the issue, in script database is like 10000 records): import cPickle # DataBase-like class class DataBase: class Arrays: pass class Zones: pass class Nodes: class CR: pass ...