serialization

Scala XML serialization

Seeing the power of Scala, I wonder if an arbitrary object graph could be serialized and deserialized to/from XML using built-in Scala language features and libraries (e.g. without XMLEncoder, XStream or JAXB). Unfortunately, I haven't found such a solution. What could you advise? ...

XamlWriter fails to serialize objects in WinForms app

Apparently XamlWriter doesn't works correctly in a WinForms application. XamlWriter uses MarkupWriter.GetMarkupObjectFor(object obj). I suppose that there's a problem to determine the full list of properties to serialize. var ar = new AssemblyReference(AppDomain.CurrentDomain.GetAssemblies().First()); var str = XamlWriter.Save(ar); Ru...

Is Serialization reliable for object size estimation?

Hi, I use serialization, in order to estimate the amount of memory used for an object. I already read this, and this. So I know that it may be better to use a profiler or sizeof (for value types). I would like to know, what is the exact difference between the serialized object and the object in memory ? In what measure is serialization ...

XML Serialization of DOM Portions with Xerces C++

I've been struggling quite a bit with Xerces C++ and my unfamiliarity with all that is XML, but I need to use XML for a project I'm working on. My question is how do I serialize portions of a DOM tree that I have already parsed and created of out of a XML instance document (validated against a schema I wrote) so that I can create many n...

How to use custom serialization during .NET remoting?

I've written a custom serialization routine that does not use ISerializable or the SerialzableAttribute to save my objects to a file. I also remote these same objects and would like to use the same serialization technique. However, I don't want to implement ISerializable because my serialization method is completely decoupled from my o...

Store data in C# source files vs. XML etc...?

This is a C# question. I was just wandering if anyone tried storing their data (like config files for example), in the *.cs file, instead of XML? I really hate XML. The whole idea of parsing html-like structure every time you need some data seems stupid. Are there lightweight alternatives (like YAML) to XML? In my case I actually need...

C# - Serializing vs Database

Hi Guys, I belive that the best way to save your application state is to a traditional relational database which most of the time its table structure is pretty much represent the data model of our system + meta data. However other guys in my team think that today its best simply serialize the entire object graph to a binary or xml file. ...

wcf serialization and nhibernate lazy loading

I'm using .net 2.0 with NHibernate/ActiveRecord and WCF. I haven't been using NH Lazy load so far, but the performance penalties are too big to ignore, so I'm starting to use it. From what I've read so far, it's not an easy subject, using NH entities with lazy loading and serializing to WCF, but the benefits are too great to ignore. U...

What is the difference between Serialization and Marshalling?

I know that in terms of several distributed techniques like RPC the term Marshalling is used, but I don't get the difference with Serialization. It both is transforming objects to series of bits no? Related: What is Serialization? What is Object Marshalling? ...

Putting an object in session via a property in ASP.NET

This seems like it might be a bad idea, but I can't figure out why: I have a class, cXYZ, with properties A, B and C. It also has a method 'sGetData' that loads those three properties from the database, and a method 'sSaveData' which saves it back. class cXYZ public property A as string... public property B as string... public ...

Serialization of Objects

how does Serialization of objects works? How object got deserialized and a instance is created from serialized date without a call to any constructor? ...

How do I deserialize XML without knowing the type beforehand?

Say I have a couple of basic objects like so: [Serializable] public class Base { public string Property1 { get; set; } public int Property2 { get; set; } } [Serializable] public class Sub: Base { public List<string> Property3 { get; set; } public Sub():base() { Property3 = new List<string>(); } ...

serialize and deserialize SQL query

I'm having an embedded device which keeps a list of inner tables. I would like it to synchronize this table's state with some outside database for debugging purposes. That is whenever I add an element to a certain struct array I wish the device to issue an "INSERT INTO ..." command. However I'm sending the data over an RS232 serial cabl...

Deserialization requires casting?

I was reading this article, where they have this code: // Serialization XmlSerializer s = new XmlSerializer( typeof( ShoppingList ) ); TextWriter w = new StreamWriter( @"c:\list.xml" ); s.Serialize( w, myList ); w.Close(); // Deserialization ShoppingList newList; TextReader r = new StreamReader( "list.xml" ); newList = (ShoppingList)s....

What is Object serialisation?(Java)

Hi In not so technical way, what is object serialization and the purpose of it? When should it be used? (any analogies exampls welcome) Thank You ...

Deserialize object into assembly that is now signed and versioned

I used to serialize a treeview with the BinaryFormatter (c#). The Assembly that did just that and which contains the all the serializable classes has now a strong name and is signed and also got a new version number (however, implementation didn't change). When I try to deserialize the byte[] array, the line (TreeViewData)binaryFormatt...

YAML as a Data DSL in .NET (C#)

Anyone out there using YAML as a data DSL in .NET? I'd like to use YAML because it's more lightweight than XML. I intend to use this DSL as a "power user" configuration tool for one of my existing applications. My concerns: How is the support for YAML using one of the .NET community libraries? Does YAML have staying power? Will ...

Returning a complex type from its XML representation in a .NET web service

I have an XML document in a database, which is the XML-serialized representation of an instance of a certain class Foo: <?xml version="1.0" encoding="utf-16"?> <Foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" <StringProp>hello</StringProp> <IntProp>5</IntProp> </Foo> Supp...

I need a serialization framework for D

I'm looking for a D template library to take an arbitrary variable and marshal it into a transportable bundle. The variable might be a basic value type (int, char[], real) or might be a struct or class and even might contain or be a reference type. A system that can do this without any per type help would be nice but I suspect that it's ...

Serializable Objects with MarshalByRefObject Fields

Alright, I'm not sure if this question has been asked before so if it has then flame away. Lets say we have two classes like this [Serializable] public class ClassA { private string _name; private ClassB _data; } public class ClassB : MarshalByRefObject { public string GetAppDomainName() { return AppDomain.Curren...