Serialization is the process of converting an object into a stream of bytes in order to persist it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed.

learn more… | top users | synonyms

0
votes
1answer
46 views

JVM memory and zero-copy (de)serialization

I am trying to understand the JVM memory model. In particular, I would like to understand whether it would be feasible to have zero-copy (de)serialization libraries, such as Cap'n Proto or ...
0
votes
0answers
38 views

Is there a pattern for deserialization involving repository access? Or what is wrong with my design?

Let us have case class Money(amount: BigDecimal, currency: Currency) case class Currency(code: String, alpha3: String) Money is a value object and Currency is an entity. When transforming Money to ...
0
votes
3answers
162 views

Java Serialization for long-ish-term storage

I have an application that uses a database of about 15,000 Java objects, which I have to read every time the application starts. Originally I've been using JSON to store the data, but that has a few ...
0
votes
0answers
24 views

Data serialization architecture, injection on construction vs. on function call

I am creating a data serialization/deserialization mechanism for essentially a persistent storage object. Due to the variety of systems this mechanism could run on, there needs to be a a variable ...
0
votes
0answers
18 views

Variable sized classes and memory mapped files

Is there an accepted way to store variable sized classes in memory mapped files, or is this always considered bad practice? Essentially I want to store a collection of image patterns files that are ...
1
vote
0answers
142 views

How do I resolve $ref in a JSON object?

I have written a single page application that uses rest services to retrieve JSON objects. The JSON objects being returned are C# objects serialized using the Newtonsoft.JSON library. The returned ...
0
votes
1answer
98 views

Why do we need to serialize data using a serialization framework e.g. avro [closed]

In this book, the author is using avro to serialize data before it is being processed by pig. What I don't understand is, why we need to do it using a serialization framework like avro? Why don't we ...
0
votes
0answers
85 views

ISerializable vs WCF attributes

In C# .NET there is two main possibilities to serialize and object. Implementing the ISerializable interface? Using the [DataContract/DataMember] serialization attribute of WCF? What are the ...
1
vote
0answers
88 views

Do serialization functions belong in a model or a controller?

I'm developing an application where: Models keep data as a multi-dimensional array, which are saved as-is to a MongoDB database. The model is used to provide methods to manipulate the data, and ...
3
votes
2answers
107 views

What's a good way to make sure that locally serialized data can be deserialized in newer code?

Context: I'm working on an HTML 5 game without persisted state. Every time you refresh the page, you start at the beginning. People are requesting that they can start where they left off if they ...
2
votes
1answer
156 views

Is serialization better done in instance methods or static methods

Say I have a class workStockItem, that I wish to serialize. Which is the better style? using a static method or using a non-static method (maybe even implemented as a property as seen below) ...
1
vote
1answer
149 views

How to migrate an XML serialization framework in Java in a tightly coupled system?

I work for a company that uses XML for storing a bunch of serialized Java classes. The framework we use is Apache Betwixt (abandonded in 2008) and it's kind of pain to maintain and extend (it seemed ...
1
vote
1answer
106 views

Front-End Business Rules / JSON

I am working on a project that now needs business rules. One design discussed is to make API calls (based on the form we are on) which responds with business rules for form input. I am unsure if this ...
1
vote
1answer
233 views

alternate approach of binary serialization/de-serialization

Is it possible to convert a list of object directly to byte[] (and vice versa) to gain performance (by avoiding serialization/de-serialization)? What I have in mind is that a list is somewhere in ...
1
vote
1answer
93 views

What is the idiomatic way to persist the data in this simple data-based application?

I'm looking at developing a simple application in Java for a game which allows a user to keep track of which items they own and how much experience they have obtained while using the item. All of this ...
2
votes
1answer
629 views

xml serialization and deserialization complex situation

I'm considering passing xml back and forth for error messages but each error has different scenarios. one situation at hand is passing diffed text comparison while others are as simple as passing a ...
2
votes
1answer
200 views

Does Serialization preclude the use of Dependency Injection?

Simple question: I understand that Serialization in C# requires default constructors. This would eliminate the possibility of using Constructor injected DI (which is generally the favored style of DI, ...
1
vote
2answers
196 views

Why is the json format necessary over the normal javascript object format?

Before you answer, yes I know that other languages have no native javascript object support, but neither do they have native support for json. So wouldn't it make much more sense to modify the json ...
2
votes
1answer
390 views

How does Java handle cyclic data references when serializing an object? [duplicate]

As an assignment question, I am asked to answer the following: How are cycles handled? Where does the term graph come from? In the examples given, there does not appear to be any clear trick ...
3
votes
1answer
111 views

Where does the term 'serialization' come from?

In order to convert e.g. a python object to json you would use a serializer. As far as I understand it, serialization leaves the possibility to change the converted object back to the original. ...
4
votes
3answers
344 views

Storing object-graphs with class-evolution in Java with transformation (long time archiving)

Abstract A common problem is to store objects (with graph), and to load them back. This is easy as long the stored object representation matches the executing code. But as time goes by, requirements ...
1
vote
2answers
1k views

Best Practices for serializing/persisting String Object Dictionary entities

I'm noticing a trend towards using a dictionary of string to object (or sometimes string to string), instead of strongly typed objects. For example, the new Katana project makes heavy use of ...
2
votes
3answers
998 views

Compatibility of Enum Vs. string constants

I was recently told that using Enum: public enum TaskEndState { Error, Completed, Running } may have compatibility/serialization issues, and thus sometimes it's better to use const string: public ...
13
votes
3answers
644 views

Are we queueing and serializing properly?

We process messages through a variety of services (one message will touch probably 9 services before it's done, each doing a specific IO-related function). Right now we have a combination of the ...
6
votes
2answers
2k views

Comparing TCP/IP applications vs HTTP applications [closed]

I'm interested in developing a large-scale user-facing website that is written in Java. As for design, I'm thinking of developing independent, modular services that can act as data providers to my ...
1
vote
2answers
281 views

Implementation of a serial communication protocol

I need to implement a serial protocol to communicate with a device using .NET (C#). This implementation should be a library (.dll) to be used in different projects. I have the datasheet that describe ...
3
votes
1answer
166 views

Class instance clustering in object reference graph for multi-entries serialization

My question is on the best way to cluster a graph of class instances around specifically marked objects (objects are the graph nodes and the references to each other are the directed edges of the ...
3
votes
3answers
644 views

Use of Abstract Syntax Notation (ASN.1)

The problem of Electronic Data Interchange over networks is well known and understood. Today, the most common formats for data interchange are things like XML and JSON. There are various pros and ...
2
votes
3answers
1k views

Serializing an object in different ways

It is usual for me, when doing web development, to copy attributes from my model classes to the other class that will be sent to the client. Usually, with a class that accepts a model and extracts the ...
0
votes
2answers
380 views

Recommended Abstraction to transfer data over a nework than byte[] array?

I was curious, why do we prefer byte[] array to transfer data over the network and not anything else? Or if I am missing anything, what are the other ways to transfer the data over a network.
1
vote
2answers
105 views

Creating documents from snippets [closed]

From time to time I create whole documents (e.g. XML or proprietary) programmatically. If it easy enough, I just write something like stringbuilder.append("<blah>"); ...
3
votes
1answer
426 views

How to serialize and deserialize lambda expression in F#?

I serialized lambda expressions in C# before. Now I wanna use F# instead of C# for serialization and deserialization. I heard F# is better in this area. Is it true? How can I do that with F#? I’d ...
3
votes
1answer
219 views

What is meant by binary compatibility? What is its importance during serialization/deserialization in a language like Java that deals in byte code?

In computing what is meant by binary compatibility? I read about it in context of serialization/deserialization that this process of serialize/deserialize should be binary compatible. What does it ...
2
votes
1answer
139 views

Dependent Object Serialization

What's the recommended way to serialize dependent objects, especially when objects are being freshly constructed (to avoid malicious byte streams, or whatever)? For example.... After creating a ...
4
votes
5answers
13k views

Java serialization - advantages and disadvantages, use or avoid?

Serialization is used for persistence in Java. It may be okay to persist a few objects using serialization. But, for a large number of objects, ORM, Database etc might be better. It seems that ...
2
votes
1answer
204 views

Good serialization solution for communication between Python AND Haskell programs? [closed]

I found this: http://msgpack.org/ But.. I've never used it, so I don't know what whether it is much good. Anybody has proposals? Basic requirements: serialize as many data structures used ...
2
votes
2answers
797 views

Validating Objects With XSDs: Is Re-Serializing Redundant or Negligible?

Context: I've got a web service that deals with request / response objects. There are strict, externally-defined schemas constraining both the structure and the content of both requests and ...
3
votes
1answer
1k views

What are your techniques for storing numpy structures in django database fields and how do you serialize them for http?

I want to publish a small web project that is supposed to contain some of my research results to present it to the scientific community. All my analysis I ran so far have been written in python ...
10
votes
1answer
1k views

Protobuf design patterns

I am evaluating Google Protocol Buffers for a Java based service (but am expecting language agnostic patterns). I have two questions: The first is a broad general question: What patterns are we ...
1
vote
6answers
4k views

Serializing Data Structures in C [closed]

I've recently read three separate books on algorithms and data structures, tcp/ip socket programming, and programming with memory. The book about memory briefly discussed the topic of serializing data ...
0
votes
0answers
148 views

Build filter conditions for entities on client side

I have the requirement that users should be able to specify filter conditions for one kind of entity through a GUI on a thin client. These conditions must be convenient to generate, meaning the GUI ...
4
votes
1answer
461 views

Pros and cons of intrusive and non-intrusive serialization?

I am interesting in the pros and cons of serialization: intrusive and non-intrusive. On the one hand it seems non-intrusive is easy to use - class to be serialized should not be updated. It seems ...
7
votes
2answers
3k views

Storing and maintaining serialized objects in C#

What are the best practices to store and maintain serialized objects in C#? Any strategies or patterns that apply? What I have come to believe so far is this: Prefer Json over XML, both for space ...
5
votes
2answers
7k views

Move from JSON to Protobuf. Is it worth it?

We have REST webservices that can serve XML or JSON (WCF). I'm toying with idea of implementing Protobufs. Why? PROS Less load on servers. Smaller message size - less traffic. It is easier to ...
10
votes
2answers
5k views

What happens if we serialize and deserialize two objects which references to each other?

To make it more clear, this is a quick example: class A implements Serializable { public B b; } class B implements Serializable { public A a; } A a = new A(); B b = new B(); a.b = b; b.a = a; So ...
-3
votes
1answer
591 views

Writing-Reading a hashtable to a text file

I'm implementing a hashtable structure for a dictionary. Dictionary is in a text file. There are 2 words on each line. I'm generating the hashtable by using the first word as a key. I'm holding the ...
5
votes
2answers
619 views

Development Patterns for dealing with Data Import / Export

I have a ASP.NET web based application that allows the end user to export data to a flat file format. (essentially taking a point-in-time backup of their work) At a later date they can re-upload ...
3
votes
3answers
293 views

Designing access to file-based “database”

It happened frequently that I have to provide access to a bunch of files organized in a directory tree according to some (sometimes loosely specified) rules. My standard pattern is to provide a ...