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

1
vote
1answer
37 views

jersey post with a huge payload

I have a requirement to write a POST endpoint where the payload is huge(not normal). In the order 10s of Megabytes. And this endpoint will be accessed by a lot of clients (in the order of 1000s) ...
0
votes
1answer
85 views

Efficient irreversible “serialization”?

Suppose we have a function f that gets a complex (non-flat) object as an input, serializes it, calculates hash of serialization results (e.g. md5) and returns calculated hash. It may use some exiting ...
1
vote
0answers
35 views

XElement.Parse and querying versus serialization (strongly typed objects)

We have a rather large code base that interacts with many SOAP based XML services. Each one of these services makes 1 to n service calls A typical low level web service call looks like this (...
0
votes
0answers
47 views

Serializing .NET object into a JSON string produces unreadable output [migrated]

I'm trying to convert a .NET object into a JSON string, because I want to be able to read the content of this object in the client side. Here is my controller code: public ActionResult Index(...
0
votes
2answers
64 views

How to calculate new property for old records efficiently?

Let's say we have classes something like this: public class Item1{ public Guid Id {get; set;} public string Name {get; set;} public decimal Price {get; set;} public int Quantity {get; ...
2
votes
2answers
46 views

When do I prefer a local DB over serialization for local data storage?

I recently started developing a small calendar application, in which I can add and view several calendar entries, which contain several data like name, date, alarm settings and so on. Those values ...
1
vote
1answer
85 views

When we need to serialize an exception

I have been developing in Java since 8 months, and I didn't face a case where I went to serialize an exception, I'm asking because I saw the serialVersionUID and how Eclipse advise to add it ...
4
votes
4answers
137 views

Serializing mutating objects

In our system a media file can have several states: invalid, empty, uploading, ingesting, ready… Depending of the state, information about the media are accessed in different ways. For example, during ...
3
votes
5answers
428 views

What is the best way to save data of a C++ Program ? Binary vs JSON serialization

We are implementing a CAD program (in C++, Qt) where we have interdependant classes : The smallest brick is the Pattern, it is just a distribution of points. Then we have Layouts which contain ...
2
votes
2answers
88 views

Is it possible to capture java objects to save them as test resources?

I'm wanting to write unit tests to check that for given database responses, certain objects are create/things are done. The problem I have, is that when mocking the database response, I have to ...
4
votes
2answers
178 views

Can StringBuilder be used to effectively store and manage multiple variables of data?

Using C# I want to create one or more text files to store all the data pertaining to a particular 'Thing' on the same line. I am presently leaning towards StringBuilder as per the following. sb....
2
votes
2answers
115 views

Why do we need namespaces when making XML serialization?

I know this might be a very basic question, but I'm new to XML serialization and spent hours trying to read different pages. PS: this is a programming language independent question.
1
vote
1answer
202 views

How can you easily unit test deserialization to different versions of an object?

I am using the protobuf-net library for serialization/deserialization of messages. Due to the distributed nature of the application some applications will have an older version of the object that is ...
6
votes
1answer
78 views

Optimizing a file type for compare tools

Context: I am developing a visual studio plugin that generates layer diagrams. I want the tool to be able to produce an intermediate output, which is the data representation of what is being rendered ...
0
votes
1answer
73 views

How to periodically serialise object's state and deserialise on initialisation in Python?

We're designing an application that is supposed to monitor a system for certain events, email interested parties to prompt them to take action when relevant and parse their replies. The application ...
-2
votes
1answer
96 views

Best way to control serialisation of posted form data [closed]

I'm working on an ASP.NET MVC project. I have a form that is strongly typed. Is it considered good practice to add serialisation attributes to the same view model to control how the data is serialized ...
1
vote
1answer
171 views

How to improve performance for serializing and deserializing a large object graph?

I have a large object graph in .NET (F# as it happens) that I need to persist to disk and then will load again periodically for use in a calculation. The performance of deserializing is more ...
1
vote
1answer
71 views

OO Design: Reading/Writing object with multiple formats

I have a class Song, which has the following public methods: String getSong(); void setSong(String); int getId(); void setId(int); Now I have two different ways I might want to store these songs in ...
1
vote
0answers
73 views

clone(serialize) v. serialize(clone)

My objects serialize() method is dependent on a call to its clone() method, because of its options to get rid of unwanted data without changing the original instance: serialize: function(opt_filters) ...
2
votes
0answers
132 views

Separate settings and implementation class hierarchies

We use XML serialization to store class settings. Each setting-class has (but doesn't reference) corresponding implementation-class. Therefore we can easily make a "settings dll" without any ...
0
votes
1answer
116 views

Designing the model layer to be serializable

I am creating simple desktop application in javaFX 8 and I would like to be able to save the state of the model and load it next time the application starts. Therefore I am implementing the ...
6
votes
2answers
795 views

Should serialization and deserialization be the responsibility of the class being serialized?

I'm currently in the (re)design phase of several model classes of a C# .NET application. (Model as in M of MVC). The model classes already have plenty of well-designed data, behaviors, and ...
0
votes
1answer
42 views

Where to store (data) classes for webservices

So I'm pretty new in my current company and my current task is to create a webservice that sends some serialized java objects from service A to service B using jaxws (webservices). The senior on the ...
3
votes
1answer
111 views

Does a serializable singleton imply both value and reference semantics at the same time?

I was reading Effective Java, and I came across passages that talk about ways you might implement a serializable singleton, as if this was a perfectly normal thing to do in Java. This immediately ...
0
votes
1answer
176 views

Java Serialization - Variables Visible in Text Editor

When I serialize my class and save it as a custom file extension, some of the variables and imports are visible when you open the file in a text editor. Is there a way to avoid this or is there an ...
0
votes
1answer
789 views

Custom serializer or create base class which implements IXmlSerializable?

I am working on a project where I have very specific xml serialization specifications, that is: Some properties are elements, some are attributes Some properties are required others aren't Some ...
0
votes
1answer
139 views

Converting from byte[ ] to user defined type

I am working on a network simulator designed in java with the basic function of routing messages through a network. I am trying to take a Message object, encrypt it using an encryption utility that ...
0
votes
1answer
101 views

Serialization - can the output from a serializer be modified and then de-serialized

I am trying to serialize a Message object using ObjectOutputStream ,take the byte[ ] output of the serializer,encrypt it using an encryption tool and then trying to de-serialize it and cast it as an ...
1
vote
1answer
225 views

Under what cirumstances would type 'System.Object' qualify for serialization?

I'm in charge of a comprehensive serialization format with support to serialize runtime objects (any derived type of Object). I can't find a sane scenario where one would choose to serialize an ...
1
vote
2answers
227 views

Class design for JSON serialization

I've been stuck for some time on a circular reference issue with JSON serialization. I have a card game that I'm pickling to a redis store. As I retrieve the Game state from redis I'm trying to ...
2
votes
1answer
69 views

Is serialization strategy part of an abi?

According to semver, the major version of a component must be updated when an abi-breaking change is incorporated. Wikipedia does a good job of describing how abi defines the interaction between ...
0
votes
1answer
27 views

standard format to describe opening schedules

I am working on a project in which I have to model opening schedules (eg a swimming pool is opened from 10:30am to 5pm on Tuesday from january to May. I try to fit this data in a csv and I started ...
1
vote
3answers
266 views

Using message queue systems - forcing synchronous processing

I have a php process producer-a which places a job on RabbitMQ a - deferring processing to a third-party service. The 3rd party service completes processing a and places a response onto queue b. I ...
-1
votes
2answers
309 views

Efficiently save big data structures [closed]

I need to save big data structure (Tree with specific nodes) into file efficiently. Data is always changing, so I need to rewrite whole data structure very often, so simple serialization is not good ...
11
votes
2answers
1k views

Best practices for serialization of DDD aggregates

According to DDD domain logic should not be polluted with technical concerns like serialization, object-relational mapping, etc. So how do you serialize or map the aggregates' state without publicly ...
0
votes
1answer
468 views

calculating the average of a value over a month [closed]

I am working on a project right now that is having me calculate monthly interest on a bank account. The way the interest is supposed to be calculated is as follows: Use the daily average to calculate ...
0
votes
1answer
625 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 FlatBuffers....
0
votes
0answers
58 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 ...
1
vote
3answers
619 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 ...
1
vote
1answer
246 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
45 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 ...
3
votes
1answer
2k 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
1k 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 ...
1
vote
0answers
283 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 ...
0
votes
1answer
140 views

Frequent file system writes in PHP when serializing objects

I am building a game based on PHP and MySQL. There is a player-vs-player mode but I figured I should add a player-vs-computer mode as well, since players may not be online at all times, especially in ...
4
votes
1answer
360 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
119 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
726 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
305 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 ...
2
votes
1answer
382 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 ...