Questions tagged [serialization]
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.
140 questions
21
votes
5
answers
5k
views
Why should I never ever ever use Java serialization?
I've heard that I should never use Java serialization (Serializable/ObjectInputStream/ObjectOutputStream) because of security. What's the problem?
1
vote
3
answers
413
views
Code generation for multi-platform, multi-language library
I need to design a code generator system that produces serialisation/deserialisation libraries for multiple languages running on multiple platforms.
Hard Constraints
I need this to capture a pre-...
4
votes
3
answers
1k
views
Does it make sense to to abstract serialization/deserialization?
Serialization and deserialization in .NET applications can be achieved using several libraries, e.g.
Newtonsoft.Json
System.Text.Json
Assuming I'm developing a new application where I want to use ...
2
votes
2
answers
188
views
How to protect class invariants when using the extraction operator?
The C++ "standard" method for serializing and deserializing a data type is to use streams with the insertion (<<) and extraction (>>) operators. This has some flaws, but it does ...
3
votes
2
answers
268
views
Serializing key-values vs array of options
Is there a reason to encode options like this:
{
"options":[
{
"name":"opt1",
"value":"val1",
},
{
...
2
votes
1
answer
163
views
Encoding hierarchy information in objects
I am writing code that will assign entities to transaction. Each transaction has a counterparty entity.
Requirements
The entities should be (de-)serialisable (from pydantic models into JSON and vice ...
11
votes
5
answers
4k
views
How do you fix the wrong-case-sensitivity dictionary setting bug-pattern?
There is a coding anti-pattern I've noticed (while using .Net). You declare a data class, which is supposed to have a dictionary field (or get/set Property), and lets call it 'Properties', for the ...
18
votes
10
answers
7k
views
Should serialization and deserialization be "atomic" transactions?
I am wondering if serialization and deserialization of classes should always be treated as an "atomic transaction?"
What I mean is, if an error were to occur during the process of ...
1
vote
3
answers
248
views
Using source code instead of XML/JSON or other custom serialization schemes and binary file formats
For a while now I have been toying with the idea of using source code as a file storage format.
My question: How to support format version changes? (loading of older files with structural differences)
...
1
vote
1
answer
545
views
Should serializable classes have different serialization versions?
I am distributing a proprietary library that includes multiple serializable classes (serializable to a file). I want versioning to the serializable classes, i.e. when serializing I put the version ...
1
vote
2
answers
167
views
What do you call a process which transforms objects of complex types into simple objects of primitive types? [closed]
My first thought was that I'm "serializing" the complex object, but from what I understand that means I'm reducing it down to a string or binary format which could be passed over a network. ...
0
votes
2
answers
551
views
Deserialization and routing of objects
I know this question has to have been answered in countless ways before, but I would appreciate some help pointing me in the correct direction.
I am developing an embedded system that receives "...
1
vote
1
answer
179
views
Programs running under Slurm for > 24 hours are being killed by process management. What are good approaches in Python to work around this issue? [closed]
I often run data processing/machine learning/filesystem-scanning scripts that can take well over 24 hours to complete. For processes with arbitrarily low memory requirements, I can run without using ...
1
vote
1
answer
969
views
Memento pattern for Undo/Redo AND Save/Load with multiple objects
In a pretty big project, I have a hierarchy of objects, let's say:
Zone object, which contains Block objects and Connection objects.
Mainliy, the Connection object links together several Block objects,...
1
vote
1
answer
645
views
Dealing with business logic on DTOs using a DDD
I have a scenario in which an Entity defines an EntityRepresentation that is created from another end. The EntityRepresentation is a value object that implements some logic that should be performed on ...