serialization

creative way for implementing Data object with its corresponding business logic class in java

I have a class that need to be serialized (for both persistentcy and client-server communication) for simplicity's sake let's call the classes Business a BusinessData and I prefix for their Interfaces. All the getter and setter are delegated from Business class to BusinessData class. I thought about implementing IBusinessData interfa...

JLS: Item 54 - Why classes having thread pool should not implement serializable?

From what I understand, the object state is just stored (values for fields, etc.), however, the execution context is anyways going to be lost. What's the point of this? What bad can happen if so? Note* this was taken from Effective Java By Joshua Bloch ...

Restore previously serialized JFrame-object, how?

Hi all. I have managed to serialize my very basic GUI-object containing a JTextArea and a few buttons to a file 'test.ser'. Now, I would like to completely restore the previously saved state from 'test.ser', but seem to have a misconception of how to properly deserialize an objects state. The class MyFrame creates the JFrame and seria...

Control serialization of GWT

I want GWT to not serialize some fields of my object (which implements Serializable interface). Normally, transient keyword would be enough. However, I also need to put the object on memcache. The use of transient keyword would make the field not being stored on memcache also. Is there any GWT-specific technique to tell the serializer t...

Resolving Circular References for Objects Implementing ISerializable

I'm writing my own IFormatter implementation and I cannot think of a way to resolve circular references between two types that both implement ISerializable. Here's the usual pattern: [Serializable] class Foo : ISerializable { private Bar m_bar; public Foo(Bar bar) { m_bar = bar; m_bar.Foo = this; } ...

Saving unserializable class

I write the programm which work with Windows Registry i want to save some Microsoft::Win32::RegistryKey in binary mode. I want to use Serialization but that class not serialazale. do i need to create my own serialazable class or there is some more easy way to save this class in binary mode in .net? ...

How to load/save C++ class instance (using STL containers) to disk

I have a C++ class representing a hierarchically organised data tree which is very large (~Gb, basically as large as I can get away with in memory). It uses an STL list to store information at each node plus iterators to other nodes. Each node has only one parent, but 0-10 children. Abstracted, it looks something like: struct node { pub...

Serialization of Entity Framework Models with .NET WCF Rest Service

I'm trying to put together a very simple REST-style interface for communicating with our partners. An example object in the API is a partner, which we'd like to have serialized like this: <partner> <id>ID</id> <name>NAME</name> </partner> This is fairly simply to achieve using the .NET 4.0 WCF REST template if we simply declar...

How can I run code in a C# class definition each time any instance of the class is deserialized?

I am trying to derive a class from ObservableCollection and I need to run just a single line of code each and every time any instance of this class is deserialized. My thought was to do this: [Serializable] public class ObservableCollection2<T> : ObservableCollection<T>, ISerializable { public ObservableCollection2() : base...

Deserialize array values to .NET properties using DataContractJsonSerializer

I'm working with the DataContractJsonSerializer in Silverlight 4 and would like to deserialize the following JSON: { "collectionname":"Books", "collectionitems": [ ["12345-67890",201, "Book One"], ["09876-54321",45, "Book Two"] ] } Into classes like the following: clas...

How can I link two Java serialised objects back together?

Sometimes (quite a lot, actually) we get a situation in Java where two objects are pointing to the same thing. Now if we serialise these separately it is quite appropriate that the serialised forms have separate copies of the object as it should be possible to open one without the other. However if we now deserialise them both, we find t...

Boost serialization stamp?

when you try to serialize object data why do get 22 serialization::archive 7 in your serialized data? how do you get rid of it? ...

There is an error in XML document (5, 14)

why I get There is an error in XML document (5, 14) while Iam trying to Deserialize an XML document.? This is the XML document: <?xml version="1.0"?> <Customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <FirstName>Khaled</FirstName> <LastName>Marouf</LastName> </Customer><...

XML Deserialization in VB/VBA

I have a set of VBA classes in an MS Access database. I have an xml string with data I want to create new classes with. Other than setting each property individually, is there an easy way to deserialize the XML into my object? I've seen the code using the TypeLib library Public Sub ISerializable_Deserialize(xml As IXMLDOMNode) Dim...

Spring bean creation via deserialization

Spring has many different ways of creating beans, but is it possible to create a bean by deserializing a resource? My application has a number of Components, and each manipulates a certain type of data. During test, the data object is instantiated directly and set directly on the component, e.g. component.setData(someDataObject). At run...

How to update non-scalar entity properties in EF 4.0?

At first I was using this as an extension method to update my detached entities... Public Sub AttachUpdated(ByVal obj As ObjectContext, ByVal objectDetached As EntityObject) If objectDetached.EntityState = EntityState.Detached Then Dim original As Object = Nothing If obj.TryGetObjectByKey(objectDetached.EntityKey, or...

How to deserialize MXML with PHP?

Hello, I have an array structure that have to be converted to MXML. I know of PEAR XML_Serialize extension but it seems the output format it produces is a bit different. PHP generated XML: <zone columns="3"> <select column="1" /> <select column="4" /> </zone> MXML format: <mx:zone columns="3"> <mx:select colu...

Using Mapped Memory Files in C# to store reference types

I need to store a dictionary to a file as fast as possible. Both key and value are objects and not guaranteed to be marked as Serializable. Also I prefer a method faster than serializing thousands of objects. So I looked into Mapped Memory Files support in .NET 4. However, it seems MemoryMappedViewAccessor only allows storage of structs ...

c# xml deserialize

I have xml wherein i have xml within it again, like: <?xml version=\"1.0\" encoding=\"UTF-8\"?> <Tag> <Value1> </Value1> <Value2><?xml version=\"1.0\" encoding=\"UTF-8\"?>... </Value2> </Tag> Deserializing doesnt work on this string in c#. I construct this string in java and send it to a c# app. how can i get around this? ...

Is Serialization of Objects threaded in Visual C++ 6.0?

Well, that's pretty much the question: Is Serialization of Objects threaded in Visual C++ 6.0? I've got a nasty bug that would be explained if this is the case, and I haven't found any documentation about it. ...