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
20 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
2answers
90 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
87 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
136 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
76 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
72 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
105 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
110 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
52 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
24 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
95 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
134 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 ...
10
votes
2answers
503 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
281 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
448 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
51 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
391 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
1answer
86 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
39 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 ...
4
votes
0answers
660 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
499 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
191 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
130 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 ...
3
votes
1answer
251 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
114 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
307 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
224 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
232 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
384 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
124 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
1k 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 ...
3
votes
1answer
381 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
221 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
937 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
136 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
510 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
2k 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 ...
3
votes
3answers
2k 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
863 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 ...
7
votes
2answers
5k 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
390 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
188 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
912 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 ...
3
votes
3answers
2k 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
465 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
118 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
654 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
266 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
192 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 ...
8
votes
5answers
21k 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 ...